/ /   = = P R E P R O C E S S O R = = 
 
 / /   @ n a m e   " B i o g r a p h y ,   A l b u m s ,   S i m i l a r   a n d   t i t l e   a r t i s t   i n f o .   w w w . l a s t . f m " 
 
 / /   @ v e r s i o n   " 0 3 0 3 2 2 0 1 8 " 
 
 / /   @ a u t h o r   " k g e n a _ u a " 
 
 / /   @ f e a t u r e   " v 1 . 4 " 
 
 / /   @ f e a t u r e   " w a t c h - m e t a d b " 
 
 / /   = = / P R E P R O C E S S O R = = 
 
 
 
 f u n c t i o n   R G B ( r , g , b )   {   r e t u r n   ( 0 x f f 0 0 0 0 0 0 | ( r < < 1 6 ) | ( g < < 8 ) | ( b ) ) ;   } 
 
 f u n c t i o n   R G B A ( r , g , b , a )   {   r e t u r n   ( ( a   < <   2 4 )   |   ( r   < <   1 6 )   |   ( g   < <   8 )   |   ( b ) ) ;   } 
 
 f u n c t i o n   g e t R e d ( c o l o r )   { r e t u r n   ( ( c o l o r   > >   1 6 )   &   0 x f f ) ; } ; 
 
 f u n c t i o n   g e t G r e e n ( c o l o r )   { r e t u r n   ( ( c o l o r   > >   8 )   &   0 x f f ) ; } ; 
 
 f u n c t i o n   g e t B l u e ( c o l o r )   { r e t u r n   ( c o l o r   &   0 x f f ) ; } ; 
 
 
 
 D T _ L E F T   =   0 x 0 0 0 0 0 0 0 0 ; 
 
 D T _ R I G H T   =   0 x 0 0 0 0 0 0 0 2 ; 
 
 D T _ C E N T E R   =   0 x 0 0 0 0 0 0 0 1 ; 
 
 D T _ V C E N T E R   =   0 x 0 0 0 0 0 0 0 4 ; 
 
 D T _ S I N G L E L I N E   =   0 x 0 0 0 0 0 0 2 0 ; 
 
 D T _ W O R D _ E L L I P S I S   =   0 x 0 0 0 4 0 0 0 0 ; 
 
 D T _ W O R D B R E A K   =   0 x 0 0 0 0 0 0 1 0 ; 
 
 D T _ C A L C R E C T   =   0 x 0 0 0 0 0 4 0 0 ; 
 
 D T _ N O P R E F I X   =   0 x 0 0 0 0 0 8 0 0 ; 
 
 
 
 M F _ E N A B L E D   =   0 x 0 0 0 0 0 0 0 0 ;       
 
 M F _ G R A Y E D   =   0 x 0 0 0 0 0 0 0 1 ; 
 
 M F _ S E P A R A T O R   =   0 x 0 0 0 0 0 8 0 0 ;     
 
 
 
 I D C _ H A N D   =   3 2 6 4 9 ; 
 
 I D C _ A R R O W   =   3 2 5 1 2 ; 
 
 
 
 V K _ S H I F T   =   0 x 1 0 ; 
 
 V K _ C O N T R O L   =   0 x 1 1 ; 	 	 
 
 	 	 
 
 v a r   w w   =   8 0 0 ,   w h   =   8 0 0 ; 	 	 
 
 	 	 
 
 S t r i n g . p r o t o t y p e . r e p e a t   =   f u n c t i o n ( n )   { 	 	 
 
         r e t u r n   n e w   A r r a y ( n   +   1 ) . j o i n ( t h i s ) ; 	 	 
 
 } 	 	 
 
 	 	 
 
 w i n d o w . S e t P r o p e r t y ( "   -   u s e r " ,   " " ) ; 	 	 
 
 i f   ( w i n d o w . G e t P r o p e r t y ( "   -   u s e r " )   ! =   " "   )   w i n d o w . S e t P r o p e r t y ( "   -   u s e r " ,   " " ) ; 
 
 w i n d o w . S e t P r o p e r t y ( " -   u s e r " ,   " " ) ; 	 	 
 
 i f   ( w i n d o w . G e t P r o p e r t y ( " -   u s e r " )   ! =   " "   )   w i n d o w . S e t P r o p e r t y ( " -   u s e r " ,   " " ) ; 	 	 
 
 w i n d o w . S e t P r o p e r t y ( " _ " . r e p e a t ( 5 0 ) ,   " " ) ; 	 	 
 
 i f   ( w i n d o w . G e t P r o p e r t y ( " _ " . r e p e a t ( 5 0 ) )   ! =   " "   )   w i n d o w . S e t P r o p e r t y ( " _ " . r e p e a t ( 5 0 ) ,   " " ) ; 	 
 
 
 
 v a r   t _ a l i g m e n t   =   { 	 	 
 
         " l e f t "       :   D T _ V C E N T E R   |   D T _ L E F T   |   D T _ N O P R E F I X , 	 	 
 
         " r i g h t "     :   D T _ V C E N T E R   |   D T _ R I G H T   |   D T _ N O P R E F I X , 	 	 
 
         " c e n t e r "   :   D T _ V C E N T E R   |   D T _ C E N T E R   |   D T _ N O P R E F I X 
 
 } ; 
 
 
 
 v a r   f _ h e a d e r _ 1   =   w i n d o w . G e t P r o p e r t y ( "   t e x t   a l i g m e n t   :   h e a d e r   1 " ,   " l e f t " ) ; 
 
 v a r   f _ h e a d e r _ 2   =   w i n d o w . G e t P r o p e r t y ( "   t e x t   a l i g m e n t   :   h e a d e r   2 " ,   " l e f t " ) ; 
 
 v a r   f _ t e x t   =   w i n d o w . G e t P r o p e r t y ( "   t e x t   a l i g m e n t   :   t e x t " ,   " l e f t " ) ; 
 
 
 
 v a r   f o n t _ n a m e _ h   =   w i n d o w . G e t P r o p e r t y ( "   f o n t   n a m e :   h e a d e r " ,   " A r i a l " ) ; 
 
 v a r   f o n t _ n a m e _ t   =   w i n d o w . G e t P r o p e r t y ( "   f o n t   n a m e :   t e x t " ,   " A r i a l " ) ; 
 
 v a r   f o n t _ s i z e _ h   =   w i n d o w . G e t P r o p e r t y ( " f o n t   s i z e :   h e a d e r " ,   1 2 ) ; 
 
 v a r   f o n t _ s i z e _ t   =   w i n d o w . G e t P r o p e r t y ( " f o n t   s i z e :   t e x t " ,   1 2 ) ; 
 
 v a r   h _ f o n t _ s t y l e   =   w i n d o w . G e t P r o p e r t y ( "   f o n t   s t y l e :   h e a d e r " ,   1 ) ; 
 
 v a r   t _ f o n t _ s t y l e   =   w i n d o w . G e t P r o p e r t y ( "   f o n t   s t y l e :   t e x t " ,   0 ) ; 
 
 v a r   m i n _ f o n t _ s i z e   =   w i n d o w . G e t P r o p e r t y ( "   f o n t   s i z e :   m i n " ,   1 2 ) ; 
 
 v a r   m a x _ f o n t _ s i z e   =   w i n d o w . G e t P r o p e r t y ( "   f o n t   s i z e :   m a x " ,   1 6 ) ; 
 
 v a r   t x t _ s h a d o w   =   w i n d o w . G e t P r o p e r t y ( "   t e x t   s h a d o w " ,   f a l s e ) ; 
 
 	 	 	 	 	 	 	 
 
 v a r   h 1 _ f o n t ,   h 2 _ f o n t ,   t _ f o n t ; 	 	 	 	 	 	 	 
 
 g e t _ f o n t ( ) ; 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
 f u n c t i o n   g e t _ f o n t ( ) { 	 	 	 	 	 	 	 
 
         h 1 _ f o n t   =   g d i . F o n t ( f o n t _ n a m e _ h ,   f o n t _ s i z e _ h ,   h _ f o n t _ s t y l e ) ; 	 	 	 	 	 	 	 
 
         h 2 _ f o n t   =   g d i . F o n t ( f o n t _ n a m e _ t ,   f o n t _ s i z e _ t ,   h _ f o n t _ s t y l e ) ; 	 	 	 	 	 	 	 
 
         t _ f o n t   =   g d i . F o n t ( f o n t _ n a m e _ t ,   f o n t _ s i z e _ t ,   t _ f o n t _ s t y l e ) ; 	 	 	 	 	 	 	 
 
 }       	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
 C o l o r T y p e C U I   =   { 	 	 	 	 	 	 	 
 
         t e x t :   0 , 	 	 	 	 	 	 	 
 
         s e l e c t i o n _ t e x t :   1 , 	 	 	 	 	 	 	 
 
         i n a c t i v e _ s e l e c t i o n _ t e x t :   2 , 	 	 	 	 	 	 	 
 
         b a c k g r o u n d :   3 , 	 	 	 	 	 	 	 
 
         s e l e c t i o n _ b a c k g r o u n d :   4 , 	 	 	 	 	 	 	 
 
         i n a c t i v e _ s e l e c t i o n _ b a c k g r o u n d :   5 , 	 	 	 	 	 	 	 
 
         a c t i v e _ i t e m _ f r a m e :   6 	 	 	 	 	 	 	 
 
 } ; 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
 C o l o r T y p e D U I   =   { 	 	 	 	 	 	 	 
 
 	 t e x t :   0 , 	 	 	 	 	 	 
 
 	 b a c k g r o u n d :   1 , 	 	 	 	 	 	 
 
 	 h i g h l i g h t :   2 , 	 	 	 	 	 	 
 
 	 s e l e c t i o n :   3 	 	 	 	 	 	 
 
 } ; 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
 f u n c t i o n   g e t _ c o l o r ( ) {       	 	 	 	 	 	 	 
 
         i f   ( w i n d o w . I n s t a n c e T y p e   = =   0 ) { 	 	 	 	 	 	 	 
 
                 b g c o l o r   =   w i n d o w . G e t C o l o r C U I ( C o l o r T y p e C U I . b a c k g r o u n d ) ; 	 	 	 	 	 	 	 
 
                 h _ c o l o r   =   w i n d o w . G e t C o l o r C U I ( C o l o r T y p e C U I . t e x t ) ; 	 	 	 	 	 	 	 
 
                 t _ c o l o r   =   w i n d o w . G e t C o l o r C U I ( C o l o r T y p e C U I . i n a c t i v e _ s e l e c t i o n _ t e x t ) ; 	 	 	 	 	 	 	 
 
         }   e l s e   i f   ( w i n d o w . I n s t a n c e T y p e   = =   1 )   {   	 	 	 	 	 	 	 
 
                 b g c o l o r   =   w i n d o w . G e t C o l o r D U I ( C o l o r T y p e D U I . b a c k g r o u n d ) ; 	 	 	 	 	 	 	 
 
                 h _ c o l o r   =   w i n d o w . G e t C o l o r D U I ( C o l o r T y p e D U I . t e x t ) ; 	 	 	 	 	 	 	 
 
                 t _ c o l o r   =   w i n d o w . G e t C o l o r D U I ( C o l o r T y p e D U I . h i g h l i g h t ) ; 	 	 	 	 	 	 	 
 
         } 	 	 	 	 	 	 	 
 
         w i n d o w . R e p a i n t ( ) ; 	 	 	 	 	 	 	 
 
 } ; 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
 v a r   c u s t o m _ c o l o r s   =   w i n d o w . G e t P r o p e r t y ( "   c o l o r s :   c u s t o m " ,   f a l s e ) ;   	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
 v a r   c _ b g c o l o r   =   c u s t o m C o l o r ( w i n d o w . G e t P r o p e r t y ( "   c o l o r :   b a c k g r o u n d " ,   " 0 - 0 - 0 " ) ) ; 	 	 	 	 	 	 	 
 
 v a r   c _ h _ c o l o r   =   c u s t o m C o l o r ( w i n d o w . G e t P r o p e r t y ( "   c o l o r :   h e a d e r " ,   " 2 5 5 - 2 5 5 - 2 2 0 " ) ) ;     	 	 	 	 	 	 	 
 
 v a r   c _ t _ c o l o r   =   c u s t o m C o l o r ( w i n d o w . G e t P r o p e r t y ( "   c o l o r :   t e x t " ,   " 1 8 0 - 1 8 0 - 1 8 0 " ) ) ; 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
 g e t _ c o l o r ( ) ; 	 	 	 	 	 	 	 
 
 i n i _ c o l o r ( ) ; 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
 f u n c t i o n   o n _ c o l o r s _ c h a n g e d ( ) { 	 	 	 	 	 	 	 
 
         g e t _ c o l o r ( ) ; 	 	 	 	 	 	 	 
 
         i n i _ c o l o r ( ) ; 	 	 	 	 	 	 	 
 
 } 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
 f u n c t i o n   i n i _ c o l o r ( ) { 	 	 	 	 	 	 	 
 
         b g c o l o r   =   c u s t o m _ c o l o r s   ?   c _ b g c o l o r   :   b g c o l o r ; 	 	 	 	 	 	 	 
 
         h _ c o l o r   =   c u s t o m _ c o l o r s   ?   c _ h _ c o l o r   :   h _ c o l o r ; 	 	 	 	 	 	 	 
 
         t _ c o l o r   =   c u s t o m _ c o l o r s   ?   c _ t _ c o l o r   :   t _ c o l o r ; 	 	 	 	 	 	 	 
 
 } 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
 f u n c t i o n   c u s t o m C o l o r ( c o l o u r ) { 	 	 	 	 	 	 	 
 
       t e m p c   =   c o l o u r . s p l i t ( " - " ) ; 	 	 	 	 	 	 	 
 
       r e t u r n   ( 0 x f f 0 0 0 0 0 0   |   ( t e m p c [ 0 ] < < 1 6 )   |   ( t e m p c [ 1 ] < < 8 )   |   ( t e m p c [ 2 ] ) ) ; 	 	 	 	 	 	 	 
 
 } 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
 v a r   c o l o r s _ s w a p   =   w i n d o w . G e t P r o p e r t y ( "   c o l o r s :   s w a p " ,   f a l s e ) ; 	 	 	 	 	 	 	 
 
 v a r   t m p _ h _ c o l o r   =   h _ c o l o r ; 	 	 	 	 	 	 	 
 
 v a r   t m p _ t _ c o l o r   =   t _ c o l o r ; 	 	 	 	 	 	 	 
 
 h _ c o l o r   =   ! c o l o r s _ s w a p   ?   t m p _ h _ c o l o r   :   t m p _ t _ c o l o r ; 	 	 	 	 	 	 	 
 
 t _ c o l o r   =   ! c o l o r s _ s w a p   ?   t m p _ t _ c o l o r   :   t m p _ h _ c o l o r ; 	 	 	 	 	 	 	 
 
 
 
 v a r   r c _ a r r   =   [ " . " ,     " / " ,     " : " ,     " * " ,     " ? " ,     ' " ' ,     " < " ,     " > " ,     " | " ] ; 
 
 
 
 w i n d o w . G e t P r o p e r t y ( " . r e s e r v e d   c h a r a c t e r s :   "   +   r c _ a r r [ 0 ]   +   "     r e p l a c e   b y " ,   " n o   c h a r " ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " . r e s e r v e d   c h a r a c t e r s :   "   +   r c _ a r r [ 1 ]   +   "     r e p l a c e   b y " ,   " - " ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " . r e s e r v e d   c h a r a c t e r s :   "   +   r c _ a r r [ 2 ]   +   "     r e p l a c e   b y " ,   " n o   c h a r " ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " . r e s e r v e d   c h a r a c t e r s :   "   +   r c _ a r r [ 3 ]   +   "     r e p l a c e   b y " ,   " x " ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " . r e s e r v e d   c h a r a c t e r s :   "   +   r c _ a r r [ 4 ]   +   "     r e p l a c e   b y " ,   " n o   c h a r " ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " . r e s e r v e d   c h a r a c t e r s :   "   +   r c _ a r r [ 5 ]   +   "     r e p l a c e   b y " ,   " ' ' " ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " . r e s e r v e d   c h a r a c t e r s :   "   +   r c _ a r r [ 6 ]   +   "     r e p l a c e   b y " ,   " _ " ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " . r e s e r v e d   c h a r a c t e r s :   "   +   r c _ a r r [ 7 ]   +   "     r e p l a c e   b y " ,   " _ " ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " . r e s e r v e d   c h a r a c t e r s :   "   +   r c _ a r r [ 8 ]   +   "     r e p l a c e   b y " ,   " n o   c h a r " ) ; 
 
 / / w i n d o w . G e t P r o p e r t y ( " . r e s e r v e d   c h a r a c t e r s :     "   +   r c _ a r r [ 9 ]   +   "     r e p l a c e   b y " ,   " n o   c h a r " ) ; 
 
 
 
 c h e c k _ c h a r _ e n t e r ( ) ; 
 
 
 
 f u n c t i o n   c h e c k _ c h a r _ e n t e r ( )   { 
 
         f o r   ( v a r   i   =   0 ;   i   <   r c _ a r r . l e n g t h ;   i + + )   { 
 
                 t m p   =   w i n d o w . G e t P r o p e r t y ( " . r e s e r v e d   c h a r a c t e r s :   "   +   r c _ a r r [ i ]   +   "     r e p l a c e   b y " ) ; 
 
                 t m p   =   t m p . l e n g t h   >   1   & &   t m p   ! =   " n o   c h a r "   & &   t m p   ! =   " s p a c e "   ?   t m p [ 0 ]   :   t m p ; 
 
                 w i n d o w . S e t P r o p e r t y ( " . r e s e r v e d   c h a r a c t e r s :   "   +   r c _ a r r [ i ]   +   "     r e p l a c e   b y " ,   t m p ) ; 
 
                 i f   ( / [ \ . \ / \ : \ * \ ? \ " \ < \ > \ | \ \ ] / g . t e s t ( t m p )   | |   t m p   = =   " " ) { 
 
                         w i n d o w . S e t P r o p e r t y ( " . r e s e r v e d   c h a r a c t e r s :   "   +   r c _ a r r [ i ]   +   "     r e p l a c e   b y " ,   " n o   c h a r " ) ; 
 
                 } 
 
                 i f   ( t m p   = =   "   " )   w i n d o w . S e t P r o p e r t y ( " . r e s e r v e d   c h a r a c t e r s :   "   +   r c _ a r r [ i ]   +   "     r e p l a c e   b y " ,   " s p a c e " ) ; 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   c h ( i ) { 
 
         v a r   t m p   =   w i n d o w . G e t P r o p e r t y ( " . r e s e r v e d   c h a r a c t e r s :   "   +   r c _ a r r [ i ]   +   "     r e p l a c e   b y " ) ; 
 
         t m p   =   t m p   = =   " n o   c h a r "   ?   " "   :   t m p ; 
 
         t m p   =   t m p   = =   " s p a c e "   ?   "   "   :   t m p ; 
 
         r e t u r n   t m p ; 
 
 } 
 
 
 
 f u n c t i o n   c l e a n ( n )   { 
 
         v a r   t m p   =   n . r e p l a c e ( / \ . / g , c h ( 0 ) ) . r e p l a c e ( / \ / / g , c h ( 1 ) ) . r e p l a c e ( / \ : / g , c h ( 2 ) ) . r e p l a c e ( / \ * / g , c h ( 3 ) ) . r e p l a c e ( / \ ? / g , c h ( 4 ) ) . r e p l a c e ( / \ " / g , c h ( 5 ) ) . r e p l a c e ( / \ < / g , c h ( 6 ) ) . r e p l a c e ( / \ > / g , c h ( 7 ) ) . r e p l a c e ( / \ | / g , c h ( 8 ) ) . r e p l a c e ( / \ \ / g , " " ) 
 
         r e t u r n   t m p . r e p l a c e ( / ^ \ s + | \ s + $ / g , " " ) . s u b s t r ( 0 ,   1 5 0 ) ; 
 
 } 
 
 
 
 f u n c t i o n   c l e a n _ i n i ( n ) { 
 
         i f   ( ! n )   r e t u r n ; 
 
         r e t u r n   n . r e p l a c e ( / [ \ [ \ ]  ' ] / g ,   " " ) ; 
 
 } 
 
 
 
 v a r   f s o   =   n e w   A c t i v e X O b j e c t ( " S c r i p t i n g . F i l e S y s t e m O b j e c t " ) ; 
 
 v a r   o b j S h e l l A p p   =   n e w   A c t i v e X O b j e c t ( " S h e l l . A p p l i c a t i o n " ) ; 
 
 
 
 v a r   w o r k _ d i r   =   w i n d o w . G e t P r o p e r t y ( "   w o r k   d i r e c t o r y " ,   " t m p _ B i o g r a p h y " ) ; 	 
 
 w o r k _ d i r   =   c l e a n ( w o r k _ d i r ) ; 
 
 w i n d o w . S e t P r o p e r t y ( "   w o r k   d i r e c t o r y " ,   w o r k _ d i r ) ; 
 
 i f   ( ! / \ S / . t e s t ( w o r k _ d i r ) )   { w o r k _ d i r   =   " t m p _ B i o g r a p h y " ;   w i n d o w . S e t P r o p e r t y ( "   w o r k   d i r e c t o r y " ,   w o r k _ d i r ) } ; 
 
 
 
 / / v a r   w o r k _ p a t h   =   f b . F o o b a r P a t h   +   c l e a n ( w o r k _ d i r )   +   " \ \ " ; 	 
 
 v a r   w o r k _ p a t h   =   f b . P r o f i l e P a t h   +   c l e a n ( w o r k _ d i r )   +   " \ \ " ; 	 
 
 
 
 c h e c k _ f o l d e r ( w o r k _ p a t h ) ; 
 
 	 	 	 	 	 	 	 
 
 v a r   s c r i p t _ p a t h   =   w o r k _ p a t h   +   " _ d o w n l o a d \ \ " ; 	 	 	 	 	 	 	 
 
 c h e c k _ f o l d e r ( s c r i p t _ p a t h ) ; 
 
 i f   ( ! f s o . F i l e E x i s t s ( s c r i p t _ p a t h   +   " d o w n l o a d . v b s " ) )   { c r e a t e _ d o w n l o a d _ f i l e ( ) } ; 	 
 
 
 
 v a r   d o c   =   n e w   A c t i v e X O b j e c t ( " h t m l f i l e " ) ; 	 	 	 	 	 	 	 	 
 
 v a r   W s h S h e l l   =   n e w   A c t i v e X O b j e c t ( " W S c r i p t . S h e l l " ) ; 	 	 	 	 	 	 	 	 
 
 v a r   v b s   =   " c s c r i p t   / / n o l o g o   \ " "   +   s c r i p t _ p a t h   +   " d o w n l o a d . v b s \ " " ; 
 
 
 
 v a r   d e f a u l t _ i m g _ p a t h _ b i o   =   w i n d o w . G e t P r o p e r t y ( "   d e f a u l t   i m g   p a t h   b i o " ,   " . \ \ m a y b e \ \ t e x t u r e s \ \ n o c o v e r \ \ n o c o v e r . p n g " ) ; 
 
 v a r   d e f a u l t _ i m g _ p a t h _ a l b u m _ r e v i e w   =   w i n d o w . G e t P r o p e r t y ( "   d e f a u l t   i m g   p a t h   a l b u m   r e v i e w " ,   " . \ \ m a y b e \ \ t e x t u r e s \ \ n o c o v e r \ \ n o c o v e r . p n g " ) ; 
 
 v a r   d e f a u l t _ i m g   =   w i n d o w . G e t P r o p e r t y ( "   d e f a u l t   i m g " ,   f a l s e ) ; 	 	 	 	 	 	 	 	 
 
 v a r   d e f a u l t _ i m g _ t r a n s p a r e n c e   =   w i n d o w . G e t P r o p e r t y ( "   d e f a u l t   i m g   t r a n s p a r e n c e   ( 0 - 2 5 5 ) " ,   2 5 5 ) ; 	 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 	 
 
 l o a d _ l a s t _ f m _ l o g o ( ) ; 
 
 v a r   l o g o _ i m g _ i d x   =   w i n d o w . G e t P r o p e r t y ( "   l o g o   i m g   ( 1 , 2   o r   3 ) " ,   1 ) ; 
 
 i f   ( ! / \ S / . t e s t ( l o g o _ i m g _ i d x )   | |   l o g o _ i m g _ i d x   <   1   | |   l o g o _ i m g _ i d x   >   3 ) { l o g o _ i m g _ i d x   =   1 ;   w i n d o w . S e t P r o p e r t y ( "   l o g o   i m g   ( 1 , 2   o r   3 ) " ,   l o g o _ i m g _ i d x ) } ; 
 
 
 
 v a r   l o g o _ i m g _ t r a n s p a r e n c e   =   w i n d o w . G e t P r o p e r t y ( "   l o g o   i m g   t r a n s p a r e n c e   ( 0 - 2 5 5 ) " ,   2 5 5 ) ; 	 
 
 v a r   l o g o _ i m g _ p a t h   =   [ ] ; 
 
 l o g o _ i m g _ p a t h [ 0 ]   =   s c r i p t _ p a t h   +   " f o o t e r _ l o g o . p n g " ; 	 	 	 	 	 	 	 	 
 
 l o g o _ i m g _ p a t h [ 1 ]   =   s c r i p t _ p a t h   +   " l a s t _ f m _ i c o . i c o " ; 	 	 	 	 	 	 	 	 
 
 l o g o _ i m g _ p a t h [ 2 ]   =   s c r i p t _ p a t h   +   " l o g o _ s t a t i c . p n g " ; 
 
 v a r   l o g o _ i m g   =   g d i . I m a g e ( l o g o _ i m g _ p a t h [ l o g o _ i m g _ i d x   -   1 ] ) ; 
 
 
 
 f u n c t i o n   a r t i s t _ f o l d e r _ p a t h ( n )   { 
 
         i f   ( ! n )   r e t u r n ; 
 
         r e t u r n   w o r k _ p a t h   +   n ; 
 
 } 
 
 
 
 f u n c t i o n   c h e c k _ f o l d e r ( n )   { 
 
         i f   ( ! n )   r e t u r n ; 
 
         t r y   { 
 
                 i f ( ! f s o . F o l d e r E x i s t s ( n ) )   { f s o . C r e a t e F o l d e r ( n ) } ; 
 
         }   c a t c h ( e )   { } 
 
 } 
 
 
 
 f u n c t i o n   g e t _ f n e x t ( p )   { 
 
         i f   ( ! p )   r e t u r n ; 
 
         r e t u r n   p . r e p l a c e ( / . * \ \ / g , ' ' ) ; 
 
 } 
 
 
 
 v a r   s e a r c h _ b y   =   [ " % a r t i s t % " ,   " % a l b u m   a r t i s t % " ,   " % r e m i x e d   b y % " ] ; 
 
 v a r   s e a r c h _ b y _ i d x   =   w i n d o w . G e t P r o p e r t y ( " s e a r c h   b y   i d x " ,   0 ) ; 
 
 
 
 v a r   n o _ i m g _ m s g   =   " " ; 
 
 v a r   g _ i m g   =   n u l l ; 
 
 v a r   p _ m a r g i n   =   w i n d o w . G e t P r o p e r t y ( "   i m g   m a r g i n " ,   0 ) ; 
 
 v a r   a l i g n _ m o d e _ a   =   n e w   A r r a y ( " a d j u s t " ,   " a d j u s t   t o p   -   c e n t e r " ,   " a d j u s t   t o p   -   l e f t " ,   " c e n t r e " ,   " c e n t r e   -   t o p " ,   " s t r e t c h " ) ; 
 
 v a r   a l i g n _ m o d e   =   w i n d o w . G e t P r o p e r t y ( " a l i g n   m o d e " ,   1 ) ; 
 
 v a r   s e l e c t e d   =   0 ; 
 
 v a r   f i l e s   =   [ ] ; 
 
 v a r   i m a g e s   =   [ ] ; 
 
 v a r   s a v e _ i m a g e s   =   w i n d o w . G e t P r o p e r t y ( " s a v e   i m a g e s " ,   t r u e ) ; 
 
 v a r   l i m i t   =   w i n d o w . G e t P r o p e r t y ( "   i m g   d o w n l o a d   l i m i t " ,   6 ) ; 
 
 i f   ( ! / \ S / . t e s t ( l i m i t )   | |   l i m i t   < =   0 )   { l i m i t   =   6 ;   w i n d o w . S e t P r o p e r t y ( "   i m g   d o w n l o a d   l i m i t " ,   l i m i t ) ; } 
 
 v a r   b o r d e r   =   w i n d o w . G e t P r o p e r t y ( "   i m g   b o r d e r " ,   t r u e ) ; 
 
 v a r   c y c l e   =   w i n d o w . G e t P r o p e r t y ( " a u t o   c y c l e   ( s e c ) " ,   0 ) ; 
 
 i f   ( c y c l e   >   0 )   s e t _ c y c l e _ t i m e r ( ) ; 
 
 v a r   c y c l e _ t x t _ y   =   2 0 ; 
 
 v a r   f a d e r   =   2 5 5 ; 
 
 v a r   f a d e _ e f f e c t   =   w i n d o w . G e t P r o p e r t y ( " f a d e   e f f e c t " ,   f a l s e ) ; 
 
 v a r   o n _ p i c   =   f a l s e ; 
 
 v a r   i m g _ f _ i n f o   =   w i n d o w . G e t P r o p e r t y ( "   i m g   f i l e   i n f o " ,   f a l s e ) ; 
 
 
 
 v a r   d o w n l o a d _ q u a l i t y   =   w i n d o w . G e t P r o p e r t y ( " d o w n l o a d   q u a l i t y " ,   1 ) ; 
 
 v a r   q u a l i t y   =   [ 
 
         [   " L o w " ,         " a v a t a r 1 7 0 s " ,       " a v a t a r 1 7 0 s " ] , 
 
         [   " M e d i u m " ,   " 5 0 0 x 0 " ,                 " 5 0 0 x 5 0 0 " ] , 
 
         [   " H i g h " ,       " 7 7 0 x 0 " ,                 " " ]   
 
 ] ; 
 
 
 
 v a r   d a t a _ m a i n   =   w i n d o w . G e t P r o p e r t y ( " d a t a _ m a i n :   b i o   o r   a l b u m ,   s i m i l a r " ,   0 ) ;   
 
 v a r   d a t a _ o t h e r _ i d x   =   w i n d o w . G e t P r o p e r t y ( " d a t a _ o t h e r _ i d x " ,   0 ) ; 
 
 v a r   d a t a _ o t h e r   =   [     
 
 / /     m e n u   t e x t ,                                       L a s t F M   q u e r y                                         f i l e   n a m e ( t o o l t i p ,   I N I   d a t a ) 
 
         [ " A l b u m s   :   m o s t   p o p u l a r " ,         " a l b u m s " ,                                               " a l b u m s _ p o p u l a r " ] , 
 
         [ " A l b u m s   :   r e l e a s e   d a t e " ,         " a l b u m s ? o r d e r = r e l e a s e _ d a t e " ,         " a l b u m s _ r e l e a s e _ d a t e " ] , 
 
         [ " S i m i l a r   a r t i s t s " ,                     " s i m i l a r " ,                                             " s i m i l a r " ] , 
 
         [ " A l b u m   : " ,                                     " " ,                                                           " a l b u m " ] , 
 
         [ " T i t l e   : " ,                                     " " ,                                                           " t i t l e " ] 
 
 ] ; 
 
 
 
 v a r   s c r o l l b a r   =   w i n d o w . G e t P r o p e r t y ( "   s c r o l l b a r " ,   t r u e ) ; 
 
 v a r   s c r o l l b a r _ w   =   w i n d o w . G e t P r o p e r t y ( "   s c r o l l b a r   w i d t h   " ,   4 ) ; 
 
 v a r   s c r o l l b a r _ k ; 
 
 v a r   s c r o l l b a r _ x   =   0 ; 
 
 v a r   s b _ p o s y   =   0 ; 
 
 v a r   o n _ s b   =   f a l s e ; 	 	 	 	 	 	 
 
 v a r   o n _ s b _ d o w n   =   f a l s e ; 	 	 	 	 	 	 
 
 v a r   s b _ c o l o r ; 	 	 	 	 	 	 
 
 	 	 	 	 	 	 
 
 v a r   b g _ t r a n s p a r e n c e   =   w i n d o w . G e t P r o p e r t y ( " t e x t   b g   t r a n s p a r e n c e   ( 0 - 2 5 5 ) " ,   1 5 0 ) ; 	 	 	 	 	 	 
 
 v a r   t _ m a r g i n   =   w i n d o w . G e t P r o p e r t y ( "   t e x t   m a r g i n " ,   1 0 ) ; 	 	 	 	 	 	 
 
 v a r   t x t _ x   =   w i n d o w . G e t P r o p e r t y ( " t x t _ x " ,   w i n d o w . W i d t h   /   2 ) ; 	 	 	 	 	 	 
 
 v a r   o l d _ t x t _ x   =   0 ; 	 	 	 	 	 	 
 
 v a r   t x t _ y   =   w i n d o w . G e t P r o p e r t y ( " t x t _ y " ,   w i n d o w . H e i g h t   /   2 ) ; 	 	 	 	 	 	 
 
 v a r   d e l t a _ x ,   d e l t a _ y ; 	 	 	 	 	 	 
 
 v a r   h _ x ,   h 1 _ y ,   h 2 _ y ,   t _ x ,   t _ y ; 	 	 	 	 	 	 
 
 v a r   s t r i n g _ w i d t h ; 
 
 
 
 v a r   r e f r e s h _ d a t a   =   f a l s e ; 
 
 v a r   c o m p l e t e _ p a t h ,   d i r e c t o r y _ p a t h ; 
 
 v a r   m e t a _ a r t i s t   =   " " ,   o l d _ a r t i s t   =   " " ; 
 
 v a r   m e t a _ a l b u m   =   " " ,   o l d _ a l b u m   =   " " ; 
 
 v a r   m e t a _ t i t l e   =   " " ,   o l d _ t i t l e   =   " " ; 
 
 
 
 v a r   t e x t   =   " " ; 	 	 	 	 	 	 
 
 v a r   h e a d e r _ 1   =   " " ; 	 	 	 	 	 	 
 
 v a r   h e a d e r _ 2   =   " " ; 
 
 v a r   t e x t _ a r r a y   =   [ ] ; 
 
 v a r   t e x t _ r o w _ h e i g h t ; 
 
 v a r   t e x t _ r o w s ; 
 
 v a r   t e x t _ v i s a b l e _ r o w s ; 
 
 v a r   t e x t _ v i s a b l e _ h e i g h t ; 
 
 v a r   i n f o _ a _ t e x t ; 
 
 v a r   s _ t e x t   =   0 ; 
 
 v a r   h 1 _ c h a r _ w i d t h ; 
 
 v a r   h 1 _ t e x t _ a r r a y   =   [ ] ; 
 
 v a r   h 1 _ t e x t _ r o w _ h e i g h t ; 
 
 v a r   h 1 _ t e x t _ v i s a b l e _ r o w s ; 
 
 v a r   h 2 _ t e x t _ a r r a y   =   [ ] ; 
 
 v a r   h 2 _ t e x t _ r o w _ h e i g h t ; 
 
 v a r   h 2 _ t e x t _ v i s a b l e _ r o w s ; 
 
 v a r   o n _ t e x t   =   f a l s e ; 
 
 v a r   o n _ h e a d e r   =   f a l s e ; 
 
 v a r   o n _ t e x t _ d o w n   =   f a l s e ; 
 
 v a r   r e f r e s h _ t x t   =   t r u e ; 
 
 v a r   t e x t _ h i d e n   =   w i n d o w . G e t P r o p e r t y ( " t x t   h i d e n " ,   f a l s e ) ; 
 
 
 
 v a r   t o o l t i p _ o n   =   f a l s e ; 
 
 v a r   t o o l t i p   =   w i n d o w . G e t P r o p e r t y ( "   t o o l t i p " ,   t r u e ) ;   
 
 v a r   t o o l t i p _ t e x t ; 
 
 v a r   p o s _ x   =   0 ,   p o s _ y   =   0 ; 
 
 
 
 v a r   l a n g u a g e _ t e x t   =   [ 
 
         [ " e n " ,   " E n g l i s h " ,       " T e x t   n o t   f o u n d " ] , 
 
         [ " i t " ,   " I t a l i a n " ,       " .   .   . " ] , 
 
         [ " z h " ,   " C h i n e s e " ,       " .   .   . " ] , 
 
         [ " d e " ,   " G e r m a n " ,         " T e x t   n i c h t   g e f u n d e n " ] , 
 
         [ " p l " ,   " P o l i s h " ,         " .   .   . " ] , 
 
         [ " p t " ,   " P o r t u g u e s e " , " .   .   . " ] , 
 
         [ " r u " ,   " R u s s i a n " ,       " "5:AB  =5  =0945=" ] , 
 
         [ " t r " ,   " T u r k i s h " ,       " .   .   . " ] , 
 
         [ " f r " ,   " F r e n c h " ,         " T e x t e   n o n   t r o u v  " ] , 
 
         [ " s v " ,   " S w e d i s h " ,       " .   .   . " ] , 
 
         [ " j a " ,   " J a p a n e s e " ,     " .   .   . " ] 
 
 ] 
 
 
 
 w i n d o w . G e t P r o p e r t y ( " e n " ,   t r u e ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " i t " ,   t r u e ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " z h " ,   t r u e ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " d e " ,   t r u e ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " p l " ,   t r u e ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " p t " ,   t r u e ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " r u " ,   t r u e ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " t r " ,   t r u e ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " f r " ,   t r u e ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " s v " ,   t r u e ) ; 
 
 w i n d o w . G e t P r o p e r t y ( " j a " ,   t r u e ) ; 
 
 
 
 v a r   l a n g _ i d x   =   w i n d o w . G e t P r o p e r t y ( " l a n g " ,   0 ) ; 
 
 v a r   t m p _ l a n g _ i d x ; 
 
 v a r   l a n g _ a r r   =   [ ] ; 
 
 c r e a t e _ l a n g _ a r r ( ) ; 
 
 
 
 f u n c t i o n   c r e a t e _ l a n g _ a r r ( ) {   
 
         l a n g _ a r r   =   [ ] ; 
 
         f o r   ( v a r   i   =   0 ;   i   <   l a n g u a g e _ t e x t . l e n g t h ;   i + + )   { 
 
                 i f   ( w i n d o w . G e t P r o p e r t y ( l a n g u a g e _ t e x t [ i ] [ 0 ] )   = =   t r u e ) { 
 
                         l a n g _ a r r . p u s h ( l a n g u a g e _ t e x t [ i ] [ 0 ] ) ; 
 
                 } 
 
         } 
 
         
 
         i f   ( l a n g _ i d x   > =   l a n g _ a r r . l e n g t h )   { 
 
                 l a n g _ i d x   =   l a n g _ i d x   -   1   < =   0   ?   0   :   l a n g _ i d x   -   1 ;   
 
                 w i n d o w . S e t P r o p e r t y ( " l a n g " ,   l a n g _ i d x ) ; 
 
                 g e t _ t e x t ( ) ; 
 
         }   
 
         
 
         i f   ( l a n g _ i d x   <   l a n g _ a r r . l e n g t h )   { 
 
                 v a r   i   =   0 ; 
 
                 d o   { 
 
                         i f   ( t m p _ l a n g _ i d x   = =   l a n g _ a r r [ i ] )   { 
 
                                 l a n g _ i d x   =   i ; 
 
                                 w i n d o w . S e t P r o p e r t y ( " l a n g " ,   l a n g _ i d x ) ; 
 
                                 g e t _ t e x t ( ) ; 
 
                         }     
 
                         i + + ; 
 
                 }   w h i l e   ( i   <   l a n g _ a r r . l e n g t h ) ; 
 
         }   
 
         
 
         i f   ( l a n g _ a r r . l e n g t h   = =   1 ) { 
 
                 t m p _ l a n g   =   l a n g _ a r r [ 0 ] ; 
 
         } 
 
         
 
         i f   ( l a n g _ a r r . l e n g t h   = =   0 ) { 
 
                 l a n g _ a r r . p u s h ( t m p _ l a n g ) ;   
 
                 w i n d o w . S e t P r o p e r t y ( t m p _ l a n g ,   t r u e ) ; 
 
                 g e t _ t e x t ( ) ; 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   l a n g _ q u e r y ( i ) { 
 
         r e t u r n   l a n g _ a r r [ i ]   = =   " e n "   ?   " "   :   l a n g _ a r r [ i ]   +   " / " ; ; 
 
 } 
 
 
 
 f u n c t i o n   g e t _ t e x t _ n f ( n )   { 
 
         t m p   =   " " ; 
 
         v a r   j   =   0 ; 
 
         d o   { 
 
                 i f   ( l a n g u a g e _ t e x t [ j ] [ 0 ]   = =   n )   { 
 
                         t m p   =   l a n g u a g e _ t e x t [ j ] [ 2 ] ; 
 
                 }     
 
                 j + + ; 
 
         }   w h i l e   ( j   <   l a n g u a g e _ t e x t . l e n g t h ) ; 
 
         r e t u r n   t m p ; 
 
 } 
 
 
 
 f u n c t i o n   g e t _ t e x t _ m e n u ( n )   { 
 
         t m p   =   " " ; 
 
         v a r   j   =   0 ; 
 
         d o   { 
 
                 i f   ( l a n g u a g e _ t e x t [ j ] [ 0 ]   = =   n )   { 
 
                         t m p   =   l a n g u a g e _ t e x t [ j ] [ 1 ] ; 
 
                 }     
 
                 j + + ; 
 
         }   w h i l e   ( j   <   l a n g u a g e _ t e x t . l e n g t h ) ; 
 
         r e t u r n   t m p ; 
 
 } 
 
 
 
 v a r   r e m a p _ d a t a   =   w i n d o w . G e t P r o p e r t y ( "   r e m a p   a r t i s t " ,   " A L L M A N   B R O T H E R S   B A N D : T H E   A L L M A N   B R O T H E R S   B A N D ; " ) ; 
 
 i f   ( ! / \ S / . t e s t ( r e m a p _ d a t a ) )   { r e m a p _ d a t a   =   " A L L M A N   B R O T H E R S   B A N D : T H E   A L L M A N   B R O T H E R S   B A N D ; " ;   w i n d o w . S e t P r o p e r t y ( "   r e m a p   a r t i s t " ,   r e m a p _ d a t a ) } ; 
 
 v a r   r e m a p _ a r r   =   [ ] ; 
 
 r e m a p _ a r r   =   r e m a p _ d a t a . s p l i t ( / [ : ; ] / g ) ; 
 
 
 
 f u n c t i o n   r e m a p _ a r t i s t ( n ) { 
 
         i f   ( ! n )   r e t u r n ; 
 
         v a r   t m p   =   " " ; 
 
         f o r   ( v a r   i   =   0 ;   i   <   r e m a p _ a r r . l e n g t h ;   i   + =   2 )   { 
 
                 i f   ( r e m a p _ a r r [ i ]   = =   n )   t m p   =   r e m a p _ a r r [ i   +   1 ] ; 
 
         } 
 
         r e t u r n   t m p   ?   t m p   :   n ; 
 
 } 
 
 
 
 v a r   m i _ r e f r e s h   =   w i n d o w . G e t P r o p e r t y ( "   m e n u   i t e m :   R e f r e s h " ,   f a l s e ) ; 
 
 
 
 v a r   p a n e l _ o n   =   t r u e ; 
 
 
 
 v a r   s e l e c t i o n _ m o d e   =   w i n d o w . G e t P r o p e r t y ( " s e l e c t i o n   m o d e " ,   0 ) ; 
 
 v a r   m e t a d b ; 
 
 o n _ i t e m _ f o c u s _ c h a n g e ( ) ; 
 
 
 
 f u n c t i o n   o n _ p a i n t ( g r ) {       
 
       ! w i n d o w . I s T r a n s p a r e n t   & &   g r . F i l l S o l i d R e c t ( 0 ,   0 ,   w w ,   w h ,   b g c o l o r ) ; 
 
       
 
         i f   ( ! m e t a _ a r t i s t ) { 
 
                 t x t _ s h a d o w   & &   g r . G d i D r a w T e x t (   " N o t h i n g   f o u n d " ,   g d i . F o n t ( " A r i a l " , 1 2 ,   0 ) ,   b g c o l o r ,   0   +   1 ,   0   +   2 ,   w w ,   w h ,   D T _ S I N G L E L I N E   |   D T _ C E N T E R   |   D T _ V C E N T E R   |   D T _ W O R D _ E L L I P S I S   ) ;   
 
                 g r . G d i D r a w T e x t (   " N o t h i n g   f o u n d " ,   g d i . F o n t ( " A r i a l " , 1 2 ,   0 ) ,   h _ c o l o r ,   0 ,   0 ,   w w ,   w h ,   D T _ S I N G L E L I N E   |   D T _ C E N T E R   |   D T _ V C E N T E R   |   D T _ W O R D _ E L L I P S I S   ) ;   
 
         } 
 
         
 
         d r a w _ i m a g e ( g r ) ;   
 
 
 
         i f   ( s e t _ c y c l e   & &   o n _ p i c ) {       
 
                 g r . F i l l S o l i d R e c t ( 0 ,   0 ,   w w ,   w h ,   R G B A ( g e t R e d ( b g c o l o r ) ,   g e t G r e e n ( b g c o l o r ) ,   g e t B l u e ( b g c o l o r ) ,   b g _ t r a n s p a r e n c e ) ) ;       
 
                 v a r   t x t _ c y c l e   =   c y c l e   = =   0   ?   " o f f "   :   c y c l e   +   "   s e c " ;       
 
                 t x t _ s h a d o w   & &   g r . G d i D r a w T e x t ( " a u t o   c y c l e :       "   +   t x t _ c y c l e ,   t _ f o n t ,   b g c o l o r ,   0   +   1 ,   c y c l e _ t x t _ y   +   2 ,   w w ,   w h ,   D T _ C E N T E R   |   D T _ W O R D _ E L L I P S I S   ) ; 
 
                 g r . G d i D r a w T e x t ( " a u t o   c y c l e :       "   +   t x t _ c y c l e ,   t _ f o n t ,   t _ c o l o r ,   0 ,   c y c l e _ t x t _ y ,   w w ,   w h ,   D T _ C E N T E R   |   D T _ W O R D _ E L L I P S I S   ) ; 
 
         }   e l s e   {     
 
                 i f   ( m e t a _ a r t i s t )   g r . F i l l S o l i d R e c t ( t x t _ x ,   t x t _ y ,   w w   -   t x t _ x ,   w h   -   t x t _ y ,   R G B A ( g e t R e d ( b g c o l o r ) , g e t G r e e n ( b g c o l o r ) , g e t B l u e ( b g c o l o r ) , b g _ t r a n s p a r e n c e ) ) ;       
 
         }       
 
 
 
         i f   ( i m g _ f _ i n f o   & &   s e t _ c y c l e   & &   o n _ p i c ) {       
 
                 d r a w _ i m g _ f i l e _ i n f o ( g r ) ;     
 
         }     
 
         
 
         d r a w _ s c r o l l b a r ( g r ) ;         
 
 
 
         f o r   ( v a r   i   =   0 ;   i   <   h 1 _ t e x t _ v i s a b l e _ r o w s ;   i   + =   1 )   {           / /   h e a d e r _ 1 
 
                 t r y   { 
 
                         t x t _ s h a d o w   & &   g r . G d i D r a w T e x t (   h 1 _ t e x t _ a r r a y [ i ] ,   h 1 _ f o n t ,   b g c o l o r ,   h _ x   +   1 ,   h 1 _ y   +   h 1 _ t e x t _ r o w _ h e i g h t   *   i   +   2 ,   s t r i n g _ w i d t h ,   w h , t _ a l i g m e n t [ f _ h e a d e r _ 1 ]   ) ;       
 
                         g r . G d i D r a w T e x t (   h 1 _ t e x t _ a r r a y [ i ] ,   h 1 _ f o n t ,   h _ c o l o r ,   h _ x ,   h 1 _ y   +   h 1 _ t e x t _ r o w _ h e i g h t   *   i ,   s t r i n g _ w i d t h ,   w h ,   t _ a l i g m e n t [ f _ h e a d e r _ 1 ]   ) ;     
 
                 }   c a t c h ( e )   { } 
 
         } 
 
 
 
         i f   ( d a t a _ m a i n   = =   1 ) { 
 
                 f o r   ( v a r   i   =   0 ;   i   <   h 2 _ t e x t _ v i s a b l e _ r o w s ;   i   + =   1 )   {   / /   h e a d e r _ 2 
 
                         t r y   { 
 
                                 t x t _ s h a d o w   & &   g r . G d i D r a w T e x t (   h 2 _ t e x t _ a r r a y [ i ] ,   h 2 _ f o n t ,   b g c o l o r ,   h _ x   +   1 ,   h 2 _ y   +   h 2 _ t e x t _ r o w _ h e i g h t   *   i   +   2 ,   s t r i n g _ w i d t h ,   w h ,   t _ a l i g m e n t [ f _ h e a d e r _ 2 ]   ) ;       
 
                                 g r . G d i D r a w T e x t (   h 2 _ t e x t _ a r r a y [ i ] ,   h 2 _ f o n t ,   t _ c o l o r ,   h _ x ,   M a t h . r o u n d ( h 2 _ y   +   h 2 _ t e x t _ r o w _ h e i g h t   *   i ) ,   s t r i n g _ w i d t h ,   w h ,   t _ a l i g m e n t [ f _ h e a d e r _ 2 ]   ) ;     
 
                         }   c a t c h ( e )   { } 
 
                 } 
 
         } 
 
 
 
         f o r   ( v a r   i   =   0 ;   i   <   t e x t _ v i s a b l e _ r o w s   *   2 ;   i   + =   2 )   {         / /   t e x t 
 
                 t r y   { 
 
                         t x t _ s h a d o w   & &   g r . G d i D r a w T e x t (   t e x t _ a r r a y [ i   +   s _ t e x t   *   2 ] . r e p l a c e ( / ^ \ s + | \ s + $ / g ,   " " ) ,   t _ f o n t ,   b g c o l o r ,   t _ x   +   1 ,   t _ y   +   t e x t _ r o w _ h e i g h t   *   i   /   2   +   2 ,   s t r i n g _ w i d t h ,   w h ,   t _ a l i g m e n t [ f _ t e x t ]   ) ; 
 
                         g r . G d i D r a w T e x t (   t e x t _ a r r a y [ i   +   s _ t e x t   *   2 ] . r e p l a c e ( / ^ \ s + | \ s + $ / g ,   " " ) ,   t _ f o n t ,   t _ c o l o r ,   t _ x ,   t _ y   +   t e x t _ r o w _ h e i g h t   *   i   /   2 ,   s t r i n g _ w i d t h ,   w h ,   t _ a l i g m e n t [ f _ t e x t ]   ) ; 
 
                 }   c a t c h ( e )   { } 
 
         } 
 
         
 
         t o o l t i p _ o n   & &   d r a w _ t o o l t i p ( g r ) ; 
 
 } 
 
 
 
 f u n c t i o n   d r a w _ i m a g e ( g r ) { 
 
         i f   ( g _ i m g   & &   i m a g e s . l e n g t h   >   0 ) { 
 
                 v a r   s i z e   =   c a l c _ i m g _ s i z e ( g _ i m g ) ; 
 
                 g r . D r a w I m a g e ( g _ i m g ,   s i z e . x ,   s i z e . y ,   s i z e . w i d t h ,   s i z e . h e i g h t ,   s i z e . c x ,   s i z e . c y ,   s i z e . c w i d t h ,   s i z e . c h e i g h t ,   0 ,   f a d e r ) ; 
 
 
 
                 v a r   l _ w   =   1 ; 
 
                 b o r d e r   & &   g r . D r a w R e c t (   s i z e . x   +   l _ w   / 2 ,   s i z e . y   +   l _ w   / 2 ,   s i z e . w i d t h   -   l _ w ,   s i z e . h e i g h t   -   l _ w ,   l _ w , R G B A ( g e t R e d ( b g c o l o r ) ,   g e t G r e e n ( b g c o l o r ) ,   g e t B l u e ( b g c o l o r ) ,   f a d e r ) ) ; 
 
         } 
 
 
 
         i f   ( ! d e f a u l t _ i m g ) { 
 
                 i f   ( ! f a d e _ e f f e c t ) { 
 
                         f a d e r _ l o g o   =   i m a g e s . l e n g t h   = =   0   ?   l o g o _ i m g _ t r a n s p a r e n c e   :   f a d e r _ l o g o ;   
 
                 } 
 
 
 
                 l o g o _ i m g   & &   g r . D r a w I m a g e ( l o g o _ i m g ,   1 0 ,   1 0 ,   l o g o _ i m g . W i d t h   *   1 ,   l o g o _ i m g . H e i g h t   *   1 ,   0 ,   0 ,   l o g o _ i m g . W i d t h ,   l o g o _ i m g . H e i g h t ,   0 ,   f a d e r _ l o g o ) ;                     
 
         } 
 
         
 
         i f   ( d e f a u l t _ i m g ) { 
 
                 t r y   { 
 
                         i f   ( d a t a _ m a i n   = =   1   & &   d a t a _ o t h e r _ i d x   = =   3 )   { 
 
                                 n c _ i m g   =   g d i . I m a g e ( d e f a u l t _ i m g _ p a t h _ a l b u m _ r e v i e w ) ; 
 
                         }   e l s e   { 
 
                                 n c _ i m g   =   g d i . I m a g e ( d e f a u l t _ i m g _ p a t h _ b i o ) ;       
 
                         } 
 
 
 
                         v a r   s i z e   =   c a l c _ i m g _ s i z e ( n c _ i m g ) ; 
 
                         f a d e r _ d e f _ i m g   =   n c _ i m g   & &   i m a g e s . l e n g t h   = =   0   ?   d e f a u l t _ i m g _ t r a n s p a r e n c e   :   f a d e r _ d e f _ i m g ; 
 
                         n c _ i m g   & &   g r . D r a w I m a g e ( n c _ i m g ,   s i z e . x ,   s i z e . y ,   s i z e . w i d t h ,   s i z e . h e i g h t ,   s i z e . c x ,   s i z e . c y ,   s i z e . c w i d t h ,   s i z e . c h e i g h t ,   0 ,   f a d e r _ d e f _ i m g ) ; 
 
                 }   c a t c h ( e )   { } ; 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   d r a w _ s c r o l l b a r ( g r ) { 
 
         s c r o l l b a r _ h   =   t e x t _ r o w s   >   t e x t _ v i s a b l e _ r o w s   ?   t e x t _ v i s a b l e _ h e i g h t   *   ( t e x t _ v i s a b l e _ r o w s   /   t e x t _ r o w s )   :   0 ; 
 
         i f   ( t e x t _ r o w s   >   t e x t _ v i s a b l e _ r o w s ) { s c r o l l b a r _ h   =   M a t h . m a x ( 5 ,   s c r o l l b a r _ h ) } ; 
 
         s c r o l l b a r _ y   =   s _ t e x t   >   0   ?   s _ t e x t   *   s c r o l l b a r _ k   :   0 ; 
 
 
 
         s c r o l l b a r _ x   =   s c r o l l b a r   ?   w w   -   t _ m a r g i n   -   s c r o l l b a r _ w   :   0 ; 
 
         
 
         s b _ a l p h a   =   o n _ s b   | |   o n _ s b _ d o w n   ?   1 5 0   :   5 0 ; 
 
         s b _ c o l o r   =   R G B A ( g e t R e d ( h _ c o l o r ) ,   g e t G r e e n ( h _ c o l o r ) ,   g e t B l u e ( h _ c o l o r ) ,   s b _ a l p h a ) ; 
 
 
 
         s c r o l l b a r   & &   g r . F i l l S o l i d R e c t ( s c r o l l b a r _ x ,   t _ y   +   s c r o l l b a r _ y ,   s c r o l l b a r _ w ,   s c r o l l b a r _ h ,   s b _ c o l o r ) ; 
 
 } 
 
 
 
 f u n c t i o n   d r a w _ i m g _ f i l e _ i n f o ( g r ) {       
 
         t x t _ s h a d o w   & &   g r . G d i D r a w T e x t (   i m g _ f i l e _ i n f o ( ) ,   g d i . F o n t ( " A r i a l " , 1 2 ,   0 ) ,   b g c o l o r ,   0   +   1 ,   c y c l e _ t x t _ y   +   2 ,   w w ,   w h ,   D T _ C E N T E R   |   D T _ W O R D B R E A K   |   D T _ N O P R E F I X ) ;   
 
         g r . G d i D r a w T e x t (   i m g _ f i l e _ i n f o ( ) ,   g d i . F o n t ( " A r i a l " , 1 2 ,   0 ) ,   h _ c o l o r ,   0 ,   c y c l e _ t x t _ y ,   w w ,   w h ,   D T _ C E N T E R   |   D T _ W O R D B R E A K   |   D T _ N O P R E F I X ) ;   
 
 } 
 
 
 
 f u n c t i o n   d r a w _ t o o l t i p ( g r ) { 
 
         t   =   t o o l t i p _ t e x t ; 
 
         t _ h   =   g r . C a l c T e x t H e i g h t ( t ,   h 2 _ f o n t )   +   2 ; 
 
         t _ w   =   g r . C a l c T e x t W i d t h ( t ,   h 2 _ f o n t )   +   1 2 ; 
 
         
 
         g r . F i l l S o l i d R e c t ( p o s _ x   -   t _ w   *   0 . 5 ,   p o s _ y   -   t _ h   -   8 ,   t _ w ,   t _ h ,   t _ c o l o r ) ; 
 
         g r . D r a w R e c t ( p o s _ x   -   t _ w   *   0 . 5 ,   p o s _ y   -   t _ h   -   8 ,   t _ w ,   t _ h ,   1 ,   b g c o l o r ) ; 
 
         g r . G d i D r a w T e x t (   t ,   h 2 _ f o n t ,   b g c o l o r ,   p o s _ x   -   t _ w   *   0 . 5 ,   p o s _ y   -   t _ h   -   8 ,   t _ w ,   t _ h ,   D T _ S I N G L E L I N E   |   D T _ C E N T E R   |   D T _ V C E N T E R ) ; 
 
 } 
 
 
 
 f u n c t i o n   o n _ p l a y l i s t _ s w i t c h ( )   { 
 
         o n _ i t e m _ f o c u s _ c h a n g e ( ) ; 
 
 } 
 
 
 
 f u n c t i o n   o n _ p l a y b a c k _ n e w _ t r a c k ( )   { 
 
         o n _ i t e m _ f o c u s _ c h a n g e ( ) ; 
 
 } 
 
 
 
 f u n c t i o n   o n _ p l a y b a c k _ d y n a m i c _ i n f o _ t r a c k ( )   { 
 
         o n _ i t e m _ f o c u s _ c h a n g e ( ) ; 
 
 } 
 
 
 
 f u n c t i o n   o n _ p l a y b a c k _ s t o p ( )   { 
 
         o n _ i t e m _ f o c u s _ c h a n g e ( ) ; 
 
 } 
 
 
 
 f u n c t i o n   o n _ s e l e c t i o n _ c h a n g e d ( m e t a d b )   { 
 
       o n _ i t e m _ f o c u s _ c h a n g e ( ) ; 
 
 } 
 
 
 
 f u n c t i o n   o n _ i t e m _ f o c u s _ c h a n g e ( )   { 
 
         s w i t c h   ( s e l e c t i o n _ m o d e )   { 
 
         c a s e   0 : 
 
                 m e t a d b   =   f b . I s P l a y i n g   ?   f b . G e t N o w P l a y i n g ( )   :   f b . G e t F o c u s I t e m ( ) ;       
 
                 b r e a k ;       
 
         c a s e   1 :       
 
                 m e t a d b   =   f b . G e t F o c u s I t e m ( ) ; 
 
                 b r e a k ;       
 
         }       
 
         i f   ( m e t a d b )   o n _ m e t a d b _ c h a n g e d ( ) ;       
 
 }       
 
 
 
 f u n c t i o n   E v a l ( f i e l d )   {       
 
         i f   ( ! m e t a d b )   r e t u r n ;       
 
         c o m p l e t e _ p a t h   =   f b . T i t l e f o r m a t ( " % p a t h % " ) . E v a l W i t h M e t a d b ( m e t a d b ) ; 
 
         d i r e c t o r y _ p a t h   =   f b . T i t l e f o r m a t ( " $ d i r e c t o r y _ p a t h ( % p a t h % ) " ) . E v a l W i t h M e t a d b ( m e t a d b ) ;   
 
         r e t u r n   c o m p l e t e _ p a t h . i n d e x O f ( ' : / / ' )   >   0   ?   f b . T i t l e F o r m a t ( " [ "   +   f i e l d   +   " ] " ) . E v a l ( t r u e )   :   f b . T i t l e F o r m a t ( " [ "   +   f i e l d   +   " ] " ) . E v a l W i t h M e t a d b ( m e t a d b ) ; 
 
 }   
 
 
 
 f u n c t i o n   o n _ m e t a d b _ c h a n g e d ( )   { 
 
         i f   ( ! p a n e l _ o n )   r e t u r n ;   
 
         i f   ( ! m e t a d b )   r e t u r n ;   
 
 
 
         s e a r c h   =   s e a r c h _ b y _ i d x   = =   2   ?   " $ i f 3 ( % r e m i x e d   b y % ,   % a l b u m   a r t i s t % ,   % a r t i s t % ) "   :   s e a r c h _ b y [ s e a r c h _ b y _ i d x ] ; 
 
 
 
         m e t a _ a l b u m   =   " " ; 
 
         m e t a _ t i t l e   =   " " ; 
 
         
 
         m e t a _ a r t i s t   =   E v a l ( s e a r c h ) ; 
 
         m e t a _ a r t i s t   =   r e m a p _ a r t i s t ( m e t a _ a r t i s t ) ; 
 
         h e a d e r _ 1   =   m e t a _ a r t i s t   ?   m e t a _ a r t i s t   :   " " ; 
 
         m e t a _ a r t i s t   =   m e t a _ a r t i s t   ?   c l e a n ( m e t a _ a r t i s t )   :   " " ; 
 
 
 
         i f   ( r e f r e s h _ d a t a ) { 
 
                 d e l _ f o l d e r ( a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t ) ) ; 
 
                 o l d _ a r t i s t   =   " " ; 
 
                 r e f r e s h _ d a t a   =   f a l s e ; 
 
         } 
 
 
 
         i f   ( m e t a _ a r t i s t   ! =   o l d _ a r t i s t ) { 
 
                 c h e c k _ f o l d e r ( a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t ) ) ; 
 
                 i f   ( ! s a v e _ i m a g e s )   d e l _ f o l d e r s ( m e t a _ a r t i s t ) ; 	 
 
                 g e t _ i m g ( m e t a _ a r t i s t ,   m e t a _ a l b u m ,   m e t a _ t i t l e ) ; 	 	 	 	 	 
 
                 o l d _ a r t i s t   =   m e t a _ a r t i s t ; 
 
                 o l d _ a l b u m   =   m e t a _ a l b u m ; 
 
                 o l d _ t i t l e   =   m e t a _ t i t l e ; 
 
         } 
 
 
 
         m e t a _ a l b u m   =   E v a l ( ' % a l b u m % ' ) ; 
 
         m e t a _ a l b u m   =   m e t a _ a l b u m   ?   c l e a n ( m e t a _ a l b u m )   :   " " ; 
 
 
 
         i f   ( m e t a _ a l b u m   & &   m e t a _ a l b u m   ! =   o l d _ a l b u m   & &   d a t a _ m a i n   = =   1   & &   d a t a _ o t h e r _ i d x   = =   3 )   { 
 
                 g e t _ i m g ( m e t a _ a r t i s t ,   m e t a _ a l b u m ,   m e t a _ t i t l e ) ; 	 
 
                 o l d _ a l b u m   =   m e t a _ a l b u m ; 
 
         } 
 
         
 
         m e t a _ t i t l e   =   E v a l ( ' % t i t l e % ' ) ; 
 
         m e t a _ t i t l e   =   m e t a _ t i t l e   ?   c l e a n ( m e t a _ t i t l e )   :   " " ; 
 
       
 
         i f   ( m e t a _ t i t l e   & &   m e t a _ t i t l e   ! =   o l d _ t i t l e   & &   d a t a _ m a i n   = =   1   & &   d a t a _ o t h e r _ i d x   = =   4 )   { 
 
                 g e t _ i m g ( m e t a _ a r t i s t ,   m e t a _ a l b u m ,   m e t a _ t i t l e ) ; 	 
 
                 o l d _ t i t l e   =   m e t a _ t i t l e ; 
 
         } 
 
 }         	 	 	 	 	 
 
 
 
 f u n c t i o n   g e t _ i m g ( t _ a r t i s t ,   t _ a l b u m ,   t _ t i t l e )   { 
 
         i f   ( g _ i m g )   g _ i m g . D i s p o s e ( ) ; 
 
         g _ i m g   =   n u l l ;         
 
         i m a g e s   =   [ ] ; 	 	 	 
 
         f i l e s   =   [ ] ; 	 	 	 
 
         s e l e c t e d   =   0 ; 
 
         n o _ i m g _ m s g   =   " " ; 
 
         c l e a r _ t x t _ v a r ( ) ; 
 
         w i n d o w . R e p a i n t ( ) ; 
 
 
 
         p a t h   =   a r t i s t _ f o l d e r _ p a t h ( t _ a r t i s t ) ; 
 
         	 	 	 	 	 
 
         i f   ( f s o . F o l d e r E x i s t s ( p a t h ) ) { 	 
 
                 g e t _ i m g _ f i l e s _ f r o m _ d i r ( p a t h ,   t _ a r t i s t ,   t _ a l b u m ,   t _ t i t l e ) ; 
 
                         
 
                 i f   ( ! g _ i m g   & &   i m a g e s . l e n g t h   >   0 )   { 
 
                         n e x t _ i m a g e ( 0 ) ; 
 
                         g e t _ t e x t ( ) ; 	 	 	 	 	 	 
 
                 }   e l s e   { 	 
 
                         s w i t c h ( d a t a _ m a i n )   { 	 	 	 	 	 	 
 
 	                 c a s e   0 : 	 	 
 
                                 g e t _ l a s t F M _ m e t a _ a r t i s t _ i m g ( p a t h ,   t _ a r t i s t ) ; 
 
                                 b r e a k ; 	 	 	 	 	 	 
 
 	                 c a s e   1 : 	 	 	 	 	 
 
                                 s w i t c h ( d a t a _ o t h e r _ i d x )   { 	 	 	 	 	 	 
 
                                 c a s e   0 : 	 	 	 	 	 	 
 
                                 c a s e   1 : 	 	 	 	 	 	 
 
                                         g e t _ l a s t F M _ a l b u m _ i m g ( p a t h ,   t _ a r t i s t ) ; 
 
                                         b r e a k ; 	 	 	 	 	 	 
 
                                 c a s e   2 : 	 	 	 	 	 	 
 
                                         g e t _ l a s t F M _ s i m i l a r _ i m g ( p a t h ,   t _ a r t i s t ) ; 
 
                                         b r e a k ; 	 
 
                                 c a s e   3 : 	 
 
                                         t _ a l b u m   & &   g e t _ l a s t F M _ m e t a _ a l b u m _ i m g ( p a t h ,   t _ a r t i s t ,   t _ a l b u m ) ; 
 
                                         b r e a k ; 
 
                                 c a s e   4 : 	 
 
                                         t _ t i t l e   & &   g e t _ l a s t F M _ m e t a _ t i t l e _ i m g ( p a t h ,   t _ a r t i s t ,   t _ a l b u m ,   t _ t i t l e ) ; 
 
                                         b r e a k ; 
 
                                 } 	 	 	 	 	 	 
 
                                 b r e a k ; 	 	 	 	 	 	 
 
                         } 	 	 	 	 	 	 
 
                 }   
 
         } 	 	 	 	 	 	 
 
 } 
 
 	 	 	 	 	 
 
 f u n c t i o n   g e t _ i m g _ f i l e s _ f r o m _ d i r ( p a t h ,   t _ a r t i s t ,   t _ a l b u m ,   t _ t i t l e )   { 	 
 
         i f   ( ! t _ a r t i s t )   r e t u r n ; 
 
         i f   ( ! t _ a l b u m   & &   d a t a _ m a i n   = =   1   & &   d a t a _ o t h e r _ i d x   = =   3 )   r e t u r n ;         
 
         i f   ( ! t _ t i t l e   & &   d a t a _ m a i n   = =   1   & &   d a t a _ o t h e r _ i d x   = =   4 )   r e t u r n ;       
 
 
 
         s w i t c h ( d a t a _ m a i n )   { 	 	 	 	 	 	 
 
         c a s e   0 : 	 
 
                 f i l e s   =   u t i l s . G l o b ( p a t h   +   " \ \ "   +   t _ a r t i s t   +   " * "   +   " a r t i s t . j p g " ) . t o A r r a y ( ) ; 
 
                 f i l e s   =   n a t u r a l S o r t ( f i l e s ) ; 	                 
 
                 b r e a k ; 	 	 	 	 	 	 
 
         c a s e   1 : 	 
 
                 s w i t c h ( d a t a _ o t h e r _ i d x )   { 	 	 	 	 	 	 
 
                 c a s e   0 : 	 	 	 	 	 	 
 
                 c a s e   1 : 	 
 
                         f i l e s   =   [ ] ;     
 
                         f o r   ( v a r   i   =   0 ;   i   <   l i m i t ;   i + + )   {   
 
                                 v a r   a l b u m   =   u t i l s . R e a d I N I (   p a t h   +   " \ \ "   +   t _ a r t i s t   +   " _ a l b u m _ i n f o . i n i " ,   d a t a _ o t h e r [ d a t a _ o t h e r _ i d x ] [ 2 ]   +   "   :   n a m e "   ,   i   ) ; 	 	 	 	 
 
                                 a l b u m   & &   f i l e s . p u s h ( p a t h   +   " \ \ "   +   t _ a r t i s t   +   " _ "   +   c l e a n ( a l b u m )   +   " . j p g " ) ; 
 
                         } 
 
                         b r e a k ; 	 
 
                 c a s e   2 : 	 
 
                         f i l e s   =   u t i l s . G l o b ( p a t h   +   " \ \ "   +   t _ a r t i s t   +   " * "   +   d a t a _ o t h e r [ d a t a _ o t h e r _ i d x ] [ 2 ]   +   " . j p g " ) . t o A r r a y ( ) ; 
 
                         f i l e s   =   n a t u r a l S o r t ( f i l e s ) ; 	                         
 
                         b r e a k ; 	 
 
                 c a s e   3 : 	 
 
                         f i l e s   =   u t i l s . G l o b ( p a t h   +   " \ \ "   +   t _ a r t i s t   +   " _ "   +   t _ a l b u m . r e p l a c e ( / [  ' ] / g ,   " * " )   +   " . j p g " ) . t o A r r a y ( ) ; 	 
 
                         b r e a k ; 
 
                 c a s e   4 : 
 
                         v a r   a l b u m   =   u t i l s . R e a d I N I (   p a t h   +   " \ \ "   +   t _ a r t i s t   +   " _ t i t l e _ i n f o . i n i " ,   c l e a n _ i n i ( t _ t i t l e ) ,   0 ) ; 
 
                         f i l e s   =   u t i l s . G l o b ( p a t h   +   " \ \ "   +   t _ a r t i s t   +   " _ "   +   c l e a n ( a l b u m )   +   " . j p g " ) . t o A r r a y ( ) ; 	 
 
                         b r e a k ; 
 
                 } 
 
                 b r e a k ;                 
 
         } 
 
 
 
         i m a g e s   =   [ ] ; 	 	 	 	 	 	 
 
 
 
         i f   ( f i l e s . l e n g t h   >   i m a g e s . l e n g t h ) { 
 
                 v a r   i   =   0 ; 
 
                 d o   { 
 
                         v a r   t m p ; 
 
                         t r y   { 	 
 
                                 t m p   =   r e s i z e _ i m a g e ( g d i . I m a g e ( f i l e s [ i ] ) ) 
 
                                 i f   ( t y p e o f   t m p   = =   ' o b j e c t '   )   { 
 
                                         i m a g e s . p u s h ( t m p ) ; 
 
                                 } 
 
                         }   c a t c h ( e )   { } 
 
                         i + + ; 
 
                 }   w h i l e   ( i   <   f i l e s . l e n g t h ) ;   
 
         } 
 
         
 
         i f   ( i m a g e s . l e n g t h   > =   0 ) { 
 
                 ! d e f a u l t _ i m g   & &   f a d e r _ t i m e r _ l o g o _ o f f ( ) ;   
 
                 d e f a u l t _ i m g   & &   f a d e r _ t i m e r _ d e f _ i m g ( ) ; 
 
         } 
 
         
 
         i f   ( i m a g e s . l e n g t h   = =   0 ) { 
 
                 ! d e f a u l t _ i m g   & &   f a d e r _ t i m e r _ l o g o _ o n ( ) ; 
 
         } 
 
         
 
         i f   ( c y c l e _ t i m e r )   s t e p   =   0 ; 
 
 } 	 	 	 	 	 	 
 
 	 	 	 	 	 	 
 
 f u n c t i o n   n e x t _ i m a g e ( d ) { 
 
         f a d e r   =   f a d e _ e f f e c t   ?   0   :   2 5 5 ; 
 
         i f   ( d   <   0 )   { s e l e c t e d   =   s e l e c t e d   < =   0   ?   i m a g e s . l e n g t h   -   1   :   s e l e c t e d   =   s e l e c t e d   -   1 } ; 
 
         i f   ( d   >   0 )   { s e l e c t e d   =   s e l e c t e d   > =   i m a g e s . l e n g t h   -   1   ?   0   :   s e l e c t e d   =   s e l e c t e d   +   1 } ; 
 
         g _ i m g   =   i m a g e s [ s e l e c t e d ] ; 
 
         
 
         i f   ( g _ i m g   & &   f a d e _ e f f e c t )   f a d e r _ t i m e r ( ) ; 
 
         w i n d o w . R e p a i n t ( ) ; 
 
         i f   ( d a t a _ m a i n   = =   1 )   { g e t _ t e x t ( ) ; } 
 
 } 
 
 
 
 f u n c t i o n   r e s i z e _ i m a g e ( i m g ) { 
 
         i f   ( ! i m g   | |   ! w w   | |   ! w h )   r e t u r n ; 
 
         
 
         v a r   s c a l e _ w   =   w w   /   i m g . W i d t h ; 
 
         v a r   s c a l e _ h   =   w h   /   i m g . H e i g h t ; 
 
         v a r   s c a l e   =   M a t h . m a x ( s c a l e _ w ,   s c a l e _ h ) ; 
 
 
 
         v a r   n w w   =   M a t h . r o u n d ( i m g . W i d t h   *   s c a l e ) ; 
 
         v a r   n w h   =   M a t h . r o u n d ( i m g . H e i g h t   *   s c a l e ) 
 
 
 
         r e t u r n   i m g . R e s i z e ( n w w ,   n w h ,   2 ) ; 
 
         i f   ( i m g )   i m g . D i s p o s e ( ) ; 
 
 } 
 
 
 
 v a r   r e q u e s t _ c o u n t e r   =   0 ; 
 
 
 
 f u n c t i o n   g e t _ t e x t ( ) { 
 
         c l e a r _ t x t _ v a r ( ) ; 
 
         
 
         s w i t c h ( d a t a _ m a i n )   { 
 
         c a s e   0 : 
 
                 g e t _ b i o _ t e x t ( ) ; 
 
                 b r e a k ; 
 
         c a s e   1 : 
 
                 s w i t c h ( d a t a _ o t h e r _ i d x )   { 
 
                 c a s e   0 : 
 
                 c a s e   1 : 
 
                         g e t _ a l b u m _ t e x t ( s e l e c t e d ) ; 
 
                         b r e a k ; 
 
                 c a s e   2 : 
 
                         g e t _ s i m i l a r _ t e x t ( s e l e c t e d ) ; 
 
                         b r e a k ; 
 
                 c a s e   3 : 
 
                         g e t _ m e t a _ a l b u m _ t e x t ( s e l e c t e d ) ; 
 
                         b r e a k ; 
 
                 c a s e   4 : 
 
                         g e t _ m e t a _ t i t l e _ t e x t ( s e l e c t e d ) ; 
 
                         b r e a k ; 
 
                 } 
 
                 b r e a k ; 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   c l e a r _ t x t _ v a r ( )   { 
 
         h e a d e r _ 2   =   " " ; 
 
         s _ t e x t   =   0 ; 
 
         t e x t   =   " " ; 
 
         i n f o _ a _ t e x t   =   " " ; 
 
         t e x t _ a r r a y   =   [ ] ; 
 
         g e t _ t e x t _ a r r a y ( ) ; 
 
         w i n d o w . R e p a i n t ( ) ; 
 
 } 
 
 
 
 f u n c t i o n   g e t _ b i o _ t e x t ( )   { 
 
         r e f r e s h _ t x t   =   t r u e ; 
 
         
 
         v a r   t x t _ f i l e   =   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t )   +   " \ \ "   +   m e t a _ a r t i s t   +   " _ b i o g r a p h y _ "   +   l a n g _ a r r [ l a n g _ i d x ]   +   " . t x t " ; 
 
 
 
 
 
         i f   ( i m a g e s . l e n g t h   = =   0   & &   r e q u e s t _ c o u n t e r   < =   1 )   { 
 
                 g e t _ l a s t F M _ m e t a _ a r t i s t _ i m g ( a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t ) ,   m e t a _ a r t i s t ) ; 	 	 	 	 
 
         }   e l s e   { 
 
                 i f   ( f s o . F i l e E x i s t s ( t x t _ f i l e ) ) { 
 
                         r e a d _ t x t _ f i l e ( t x t _ f i l e ) ; 
 
                 }   e l s e   { 
 
                         g e t _ l a s t F M _ b i o _ t e x t ( t x t _ f i l e ,   m e t a _ a r t i s t ) ; 	 	 	 	 
 
                 } 	 	 	 	 
 
                 r e q u e s t _ c o u n t e r   =   0 ; 
 
         } 
 
         r e q u e s t _ c o u n t e r + + ; 
 
 } 	 	 	 	 
 
 	 	 	 	 
 
 f u n c t i o n   g e t _ a l b u m _ t e x t ( s )   { 	 	 	 
 
         r e f r e s h _ t x t   =   t r u e ; 	 	 	 	 
 
 
 
         v a r   a l b u m   =   u t i l s . R e a d I N I (   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t )   +   " \ \ "   +   m e t a _ a r t i s t   +   " _ a l b u m _ i n f o . i n i " ,   d a t a _ o t h e r [ d a t a _ o t h e r _ i d x ] [ 2 ]   +   "   :   n a m e "   ,   s   ) ; 	 	 	 	 
 
         v a r   t x t _ f i l e   =   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t )   +   " \ \ "   +   m e t a _ a r t i s t   +   " _ "   +   c l e a n ( a l b u m )   +   " _ "   +   l a n g _ a r r [ l a n g _ i d x ]   +   " . t x t " ;       
 
         h e a d e r _ 2   =   a l b u m ; 	 	 	 	 
 
 
 
         i n f o _ a _ t e x t   =   g e t _ a l b u m _ i n f o _ t e x t ( s ) ; 	 
 
 
 
         i f   ( ! i n f o _ a _ t e x t   & &   r e q u e s t _ c o u n t e r   < =   1 )   { 
 
                 g e t _ l a s t F M _ a l b u m _ i m g ( a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t ) ,   m e t a _ a r t i s t ) ; 	 	 	 	 
 
         }   e l s e   { 
 
                 i f   ( f s o . F i l e E x i s t s ( t x t _ f i l e ) ) { 	 	 	 
 
                         r e a d _ t x t _ f i l e ( t x t _ f i l e ) ; 	 	 	 
 
                 }   e l s e { 	 
 
                         g e t _ l a s t F M _ a l b u m _ t e x t ( t x t _ f i l e ,   a l b u m   ?   m e t a _ a r t i s t   :   " " ,   a l b u m ) ; 
 
                 } 
 
                 r e q u e s t _ c o u n t e r   =   0 ;                 
 
         } 
 
         r e q u e s t _ c o u n t e r + + ; 
 
 } 	 	 	 
 
 
 
 f u n c t i o n   g e t _ m e t a _ a l b u m _ t e x t ( s )   { 	 	 	 
 
         r e f r e s h _ t x t   =   t r u e ; 	 	 	 	 
 
 
 
         v a r   t x t _ f i l e   =   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t )   +   " \ \ "   +   m e t a _ a r t i s t   +   " _ "   +   m e t a _ a l b u m   +   " _ "   +   l a n g _ a r r [ l a n g _ i d x ]   +   " . t x t " ;       
 
         v a r   a l b u m   =   m e t a _ a l b u m ; 	 	 	 	 
 
         h e a d e r _ 2   =   a l b u m ; 	 
 
 	 	 	 
 
         i n f o _ a _ t e x t   =   g e t _ a l b u m _ i n f o _ t e x t ( s ) ; 
 
         
 
         i f   ( ! i n f o _ a _ t e x t   & &   r e q u e s t _ c o u n t e r   < =   1 )   { 	 
 
                 g e t _ l a s t F M _ m e t a _ a l b u m _ i m g ( a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t ) ,   m e t a _ a r t i s t ,   a l b u m ) ; 
 
         }   e l s e   { 	 	 	 
 
                 i f   ( f s o . F i l e E x i s t s ( t x t _ f i l e ) ) { 	 	 	 
 
                         r e a d _ t x t _ f i l e ( t x t _ f i l e ) ; 	 	 	 
 
                 }   e l s e { 	 	 	 
 
                         g e t _ l a s t F M _ a l b u m _ t e x t ( t x t _ f i l e ,   m e t a _ a r t i s t ,   a l b u m ) ; 
 
                 } 	 
 
                 r e q u e s t _ c o u n t e r   =   0 ;         	 	 
 
         } 
 
         r e q u e s t _ c o u n t e r + + ; 
 
 } 
 
 
 
 f u n c t i o n   g e t _ a l b u m _ i n f o _ t e x t ( s )   { 
 
         s w i t c h ( d a t a _ o t h e r _ i d x )   { 
 
         c a s e   0 : 
 
         c a s e   1 : 
 
         c a s e   2 : 
 
                 v a r   i n f o   =   u t i l s . R e a d I N I (   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t )   +   " \ \ "   +   m e t a _ a r t i s t   +   " _ a l b u m _ i n f o . i n i " ,   d a t a _ o t h e r [ d a t a _ o t h e r _ i d x ] [ 2 ]   +   "   :   i n f o   :   "   +   l a n g _ a r r [ l a n g _ i d x ] ,   s   ) ;           
 
                 b r e a k ; 
 
         c a s e   3 : 
 
                 v a r   i n f o   =   u t i l s . R e a d I N I (   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t )   +   " \ \ "   +   m e t a _ a r t i s t   +   " _ a l b u m _ i n f o . i n i " ,   c l e a n _ i n i ( m e t a _ a l b u m ) ,   l a n g _ a r r [ l a n g _ i d x ] ) ;     
 
                 b r e a k ; 
 
         c a s e   4 : 
 
                 v a r   i n f o   =   u t i l s . R e a d I N I (   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t )   +   " \ \ "   +   m e t a _ a r t i s t   +   " _ t i t l e _ i n f o . i n i " ,   c l e a n _ i n i ( m e t a _ t i t l e ) ,   l a n g _ a r r [ l a n g _ i d x ] ) ;     
 
                 b r e a k ; 
 
         } 
 
         r e t u r n   ( i n f o   ?   i n f o . r e p l a c e ( / \ * / g ,   " \ n " )   +   " \ n \ n "   :   " " ) ;   
 
 } 	 	 	 
 
 	 	 	 
 
 f u n c t i o n   g e t _ s i m i l a r _ t e x t ( s )   { 
 
         r e f r e s h _ t x t   =   t r u e ; 
 
         
 
         v a r   t x t _ f i l e   =   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t )   +   " \ \ "   +   m e t a _ a r t i s t   +   " _ "   +   s   +   " _ "   +     d a t a _ o t h e r [ d a t a _ o t h e r _ i d x ] [ 2 ]   +   " _ "   +   l a n g _ a r r [ l a n g _ i d x ]   +   " . t x t " ;       
 
         v a r   s i m i l a r _ a r t i s t   =   u t i l s . R e a d I N I (   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t )   +   " \ \ "   +   m e t a _ a r t i s t   +   " _ a l b u m _ i n f o . i n i " ,   d a t a _ o t h e r [ d a t a _ o t h e r _ i d x ] [ 2 ]   +   "   :   n a m e "   ,   s   ) ; 
 
         h e a d e r _ 2   =   s i m i l a r _ a r t i s t ; 
 
 
 
         i f   ( ! s i m i l a r _ a r t i s t   & &   r e q u e s t _ c o u n t e r   < =   1 )   { 
 
                 g e t _ l a s t F M _ s i m i l a r _ i m g ( a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t ) ,   m e t a _ a r t i s t ) ; 
 
         }   e l s e   { 
 
                 i f   ( f s o . F i l e E x i s t s ( t x t _ f i l e ) ) { 
 
                         r e a d _ t x t _ f i l e ( t x t _ f i l e ) ; 
 
                 }   e l s e   { 
 
                           g e t _ l a s t F M _ b i o _ t e x t ( t x t _ f i l e ,   s i m i l a r _ a r t i s t ) ;     
 
                 } 
 
                 r e q u e s t _ c o u n t e r   =   0 ;     
 
         } 
 
         r e q u e s t _ c o u n t e r + + ; 
 
 } 
 
 
 
 f u n c t i o n   g e t _ m e t a _ t i t l e _ t e x t ( s )   { 	 	 	 
 
         r e f r e s h _ t x t   =   t r u e ; 	 	 	 	 
 
 
 
         v a r   t x t _ f i l e   =   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t )   +   " \ \ "   +   " t i t l e _ "   +   m e t a _ t i t l e   +   " _ "   +   l a n g _ a r r [ l a n g _ i d x ]   +   " . t x t " ;       	 	 	 	 
 
         v a r   t i t l e   =   m e t a _ t i t l e ; 	 	 	 	 
 
         h e a d e r _ 2   =   t i t l e ; 	 	 	 	 
 
 	 	 	 
 
         i n f o _ a _ t e x t   =   g e t _ a l b u m _ i n f o _ t e x t ( s ) ; 
 
         
 
         i f   ( ! i n f o _ a _ t e x t   & &   r e q u e s t _ c o u n t e r   < =   1 )   { 	 
 
                 g e t _ l a s t F M _ m e t a _ t i t l e _ i m g ( a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t ) ,   m e t a _ a r t i s t ,   " " ,   t i t l e ) ; 
 
         }   e l s e   { 	 	 	 
 
                 i f   ( f s o . F i l e E x i s t s ( t x t _ f i l e ) ) { 	 	 	 
 
                         r e a d _ t x t _ f i l e ( t x t _ f i l e ) ; 	 	 	 
 
                 }   e l s e { 	 	 	 
 
                         g e t _ l a s t F M _ m e t a _ t i t l e _ t e x t ( t x t _ f i l e ,   m e t a _ a r t i s t ,   m e t a _ a l b u m ,   t i t l e ) ; 
 
                 } 	 
 
                 r e q u e s t _ c o u n t e r   =   0 ;         	 	 
 
         } 
 
         r e q u e s t _ c o u n t e r + + ; 
 
 } 
 
 
 
 f u n c t i o n   r e a d _ t x t _ f i l e ( f i l e ) { 
 
         i f   ( ! f i l e )   r e t u r n ;   
 
         t e x t   =   u t i l s . R e a d T e x t F i l e ( f i l e ) ; 
 
         g e t _ t e x t _ a r r a y ( ) ; 
 
 } 
 
 
 
 f u n c t i o n   g e t _ t e x t _ a r r a y ( )   { 
 
         h _ x   =   t x t _ x   +   t _ m a r g i n ; 
 
         h 1 _ y   =   M a t h . r o u n d ( t x t _ y )   +   t _ m a r g i n ; 
 
         t _ x   =   t x t _ x   +   t _ m a r g i n ; 
 
 
 
         s t r i n g _ w i d t h   =   s c r o l l b a r   ?   M a t h . m a x ( w w   -   t _ x   -   t _ m a r g i n   -   s c r o l l b a r _ w   -   1 0 ,   0 )   :   M a t h . m a x ( w w   -   t _ x   -   t _ m a r g i n ,   0 ) ; 
 
 
 
         t e m p _ b m p   =   g d i . C r e a t e I m a g e ( 1 ,   1 ) ; 
 
         t e m p _ g r   =   t e m p _ b m p . G e t G r a p h i c s ( ) ; 
 
         
 
         h 1 _ c h a r _ w i d t h   =   t e m p _ g r . C a l c T e x t W i d t h ( h e a d e r _ 1 . s u b s t r ( 0 ,   1 ) ,   h 1 _ f o n t ) ; 
 
 
 
         h 1 _ t e x t _ r o w _ h e i g h t   =   t e m p _ g r . C a l c T e x t H e i g h t ( " H e a d e r _ 1 " ,   h 1 _ f o n t ) ; 
 
         h 1 _ t e x t _ v i s a b l e _ a r e a   =   M a t h . f l o o r ( M a t h . m a x ( 0 ,   w i n d o w . H e i g h t   -   t _ m a r g i n   -   h 1 _ y ) ) ; 
 
         h 1 _ t e x t _ v i s a b l e _ r o w s   =   M a t h . m a x ( 1 ,   M a t h . f l o o r ( h 1 _ t e x t _ v i s a b l e _ a r e a   /   h 1 _ t e x t _ r o w _ h e i g h t ) ) ; 
 
 
 
         h 1 _ t e x t _ a r r a y   =   [ ] ; 
 
         v a r   h 1 _ t e x t _ a r r a y _ t m p   =   t e m p _ g r . E s t i m a t e L i n e W r a p ( h e a d e r _ 1 ,   h 1 _ f o n t ,   s t r i n g _ w i d t h ) . t o A r r a y ( ) ; 
 
 
 
         f o r   ( v a r   i   =   0 ;   i   <   h 1 _ t e x t _ a r r a y _ t m p . l e n g t h ;   i   + =   2 )   { 
 
                 h 1 _ t e x t _ a r r a y . p u s h ( h 1 _ t e x t _ a r r a y _ t m p [ i ] . r e p l a c e ( / ^ \ s + | \ s + $ / g ,   " " ) ) ; 
 
         } 
 
 
 
         h 2 _ y   =   h 1 _ y   +   h 1 _ t e x t _ a r r a y . l e n g t h   *   h 1 _ t e x t _ r o w _ h e i g h t ; 
 
 
 
         h 2 _ t e x t _ r o w _ h e i g h t   =   t e m p _ g r . C a l c T e x t H e i g h t ( " H e a d e r _ 2 " ,   h 2 _ f o n t ) ; 
 
         h 2 _ t e x t _ v i s a b l e _ a r e a   =   M a t h . f l o o r ( M a t h . m a x ( 0 ,   w i n d o w . H e i g h t   -   t _ m a r g i n   -   h 2 _ y ) ) ; 
 
         h 2 _ t e x t _ v i s a b l e _ r o w s   =   M a t h . f l o o r ( h 2 _ t e x t _ v i s a b l e _ a r e a   /   h 2 _ t e x t _ r o w _ h e i g h t ) ; 
 
 
 
         h 2 _ t e x t _ a r r a y   =   [ ] ; 
 
         v a r   h 2 _ t e x t _ a r r a y _ t m p   =   t e m p _ g r . E s t i m a t e L i n e W r a p ( h e a d e r _ 2 ,   h 2 _ f o n t ,   s t r i n g _ w i d t h ) . t o A r r a y ( ) ; 
 
 
 
         f o r   ( v a r   i   =   0 ;   i   <   h 2 _ t e x t _ a r r a y _ t m p . l e n g t h ;   i   + =   2 )   { 
 
                 h 2 _ t e x t _ a r r a y . p u s h ( h 2 _ t e x t _ a r r a y _ t m p [ i ] . r e p l a c e ( / ^ \ s + | \ s + $ / g ,   " " ) ) ; 
 
         } 
 
         
 
         t e x t _ r o w _ h e i g h t   =   t e m p _ g r . C a l c T e x t H e i g h t ( " B i o g r a p h y " ,   t _ f o n t ) ; 
 
         
 
         t _ y   =   ( d a t a _ m a i n   = =   1   ?   h 2 _ y   +   h 2 _ t e x t _ a r r a y . l e n g t h   *   h 2 _ t e x t _ r o w _ h e i g h t   :   h 1 _ y   +   h 1 _ t e x t _ a r r a y . l e n g t h   *   h 1 _ t e x t _ r o w _ h e i g h t )   +   t e x t _ r o w _ h e i g h t ; 
 
 
 
         v a r   t   =   n o _ i m g _ m s g   +   i n f o _ a _ t e x t   +   t e x t 
 
 
 
         i f   ( M a t h . a b s ( t x t _ x   -   o l d _ t x t _ x )   >   5   | |   r e f r e s h _ t x t ) { 
 
                 t e x t _ a r r a y   =   [ ] ; 
 
                 i f   ( t e x t   | |   i n f o _ a _ t e x t )   t e x t _ a r r a y   =   t e m p _ g r . E s t i m a t e L i n e W r a p ( t ,   t _ f o n t ,   s t r i n g _ w i d t h ) . t o A r r a y ( ) ; 
 
                 o l d _ t x t _ x   =   t x t _ x ; 
 
                 r e f r e s h _ t x t   =   f a l s e ; 
 
         } 
 
         
 
         t e x t _ r o w s   =   t e x t _ a r r a y . l e n g t h   /   2 ; 
 
 
 
         b _ t e x t _ v i s a b l e _ a r e a   =   M a t h . f l o o r ( M a t h . m a x ( 0 ,   w i n d o w . H e i g h t   -   t _ m a r g i n   -   t _ y ) ) ; 
 
         t e x t _ v i s a b l e _ r o w s   =   M a t h . f l o o r ( b _ t e x t _ v i s a b l e _ a r e a   /   t e x t _ r o w _ h e i g h t ) ; 
 
         t e x t _ v i s a b l e _ h e i g h t   =   t e x t _ v i s a b l e _ r o w s   *   t e x t _ r o w _ h e i g h t ; 
 
 
 
         i f   ( t e x t _ v i s a b l e _ r o w s   +   s _ t e x t   >   t e x t _ r o w s   & &   s _ t e x t   >   0 )   { 
 
                 s _ t e x t   =   ( t e x t _ r o w s   -   t e x t _ v i s a b l e _ r o w s ) ; 
 
         } 
 
 
 
         s c r o l l b a r _ k   =   t e x t _ v i s a b l e _ h e i g h t   /   t e x t _ r o w s ; 
 
 
 
         t e m p _ b m p . R e l e a s e G r a p h i c s ( t e m p _ g r ) ; 
 
         t e m p _ b m p . D i s p o s e ( ) ; 
 
         t e m p _ g r   =   n u l l ; 
 
         t e m p _ b m p   =   n u l l ; 
 
         w i n d o w . R e p a i n t ( ) ; 
 
         C o l l e c t G a r b a g e ( ) ; 
 
 } 
 
 
 
 f u n c t i o n   s t r i p _ t a g s ( t )   { 
 
         d o c . o p e n ( ) ; 
 
         v a r   d i v   =   d o c . c r e a t e E l e m e n t ( " d i v " ) ; 
 
         d i v . i n n e r H T M L   =   t . r e p l a c e ( / < [ P p ] [ ^ > ] * > / g ,   " " ) . r e p l a c e ( / < \ / [ P p ] > / g ,   " < b r > " ) . r e p l a c e ( / \ n / g ,   " < b r > " ) ; 
 
         v a r   t e x t   =   d i v . i n n e r T e x t ; 
 
         d o c . c l o s e ( ) ; 
 
         r e t u r n   t e x t ; 
 
 } 
 
 
 
 f u n c t i o n   s a v e _ t x t _ f i l e ( t ,   f i l e ) { 
 
         i f   ( ! t   | |   ! m e t a _ a r t i s t )   r e t u r n ;   
 
         i f   ( f s o . F o l d e r E x i s t s ( a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t ) ) ) { 
 
                 t r y   { 
 
                         f i l e   =   f s o . O p e n T e x t F i l e (   f i l e ,   2 ,   t r u e ,   - 1 ) 
 
                         f i l e . W r i t e ( t ) ; 
 
                         f i l e . C l o s e ( ) ; 
 
                 }   c a t c h ( e )   { 
 
                         r e t u r n ; 
 
                 } 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   o n _ m o u s e _ r b t n _ u p   ( x ,   y ) {           
 
         v a r   _ m e n u   =   w i n d o w . C r e a t e P o p u p M e n u ( ) ; 
 
 
 
         f o r   ( v a r   i   =   1 ;   i   <   l a n g _ a r r . l e n g t h   +   1 ;   i + + )   { 
 
                 m e n u I t e m   =   g e t _ t e x t _ m e n u ( l a n g _ a r r [ i   -   1 ] ) ; 
 
                 _ m e n u . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   i ,   m e n u I t e m ) ;     
 
                 _ m e n u . C h e c k M e n u R a d i o I t e m ( i ,   l a n g _ a r r . l e n g t h   +   1 ,   w i n d o w . G e t P r o p e r t y ( " l a n g " )   +   1 ) ;   
 
                 _ m e n u . E n a b l e M e n u I t e m ( w i n d o w . G e t P r o p e r t y ( " l a n g " )   +   1 ,   1 ) ; 
 
         } 
 
         
 
         _ f i r s t g r o u p   =   w i n d o w . C r e a t e P o p u p M e n u ( ) ;   
 
         _ f i r s t g r o u p . A p p e n d T o ( _ m e n u , M F _ E N A B L E D ,   " S e l e c t   o f   l a n g u a g e s " ) ; 
 
 
 
         f o r   ( v a r   i   =   2 0 ;   i   <   l a n g u a g e _ t e x t . l e n g t h   +   2 0 ;   i + + )   { 
 
                 m e n u I t e m   =   l a n g u a g e _ t e x t [ i   -   2 0 ] [ 1 ] ; 
 
                 _ f i r s t g r o u p . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   i ,   m e n u I t e m ) ;       
 
                 _ m e n u . C h e c k M e n u I t e m ( i ,   w i n d o w . G e t P r o p e r t y ( l a n g u a g e _ t e x t [ i   -   2 0 ] [ 0 ] ) ) ; 
 
         } 
 
 
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S E P A R A T O R ,   0 ,   0 ) ;       
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   4 0 ,   " P r e f e r   n o w   p l a y i n g " ) ;       
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   4 1 ,   " F o l l o w   s e l e c t e d   t r a c k " ) ;       
 
         _ m e n u . C h e c k M e n u R a d i o I t e m ( 4 0 ,   4 1   ,   s e l e c t i o n _ m o d e   +   4 0 ) ;       
 
         _ m e n u . E n a b l e M e n u I t e m ( s e l e c t i o n _ m o d e   +   4 0 ,   1 ) ; 
 
 
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S E P A R A T O R ,   0 ,   0 ) ;   
 
         
 
         v a r   a r t i s t _ t x t   =   m e t a _ a r t i s t   ?   ( m e t a _ a r t i s t . l e n g t h   > =   2 5   ?   m e t a _ a r t i s t . s u b s t r ( 0 ,   2 5 )   +   "   . . . "   :   m e t a _ a r t i s t )   :   "   . . . " ; 
 
 
 
         M F _ S T R I N G   =   m e t a _ a r t i s t   ?   M F _ E N A B L E D   :   M F _ G R A Y E D ; 
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   5 0 ,   " A r t i s t   :   "   +   a r t i s t _ t x t   +   ( d a t a _ m a i n   = =   1   ?   "   * "   :   " " ) ) ;   
 
         _ m e n u . C h e c k M e n u R a d i o I t e m ( 5 0 ,   5 0   ,   d a t a _ m a i n   +   5 0 ) ; 
 
         _ m e n u . E n a b l e M e n u I t e m ( d a t a _ m a i n   +   5 0 ,   1 ) ; 
 
         
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   5 2 ,   d a t a _ o t h e r [ 0 ] [ 0 ]   +   ( d a t a _ m a i n   = =   0   & &   d a t a _ o t h e r _ i d x   = =   0   ?   "   * "   :   " " ) ) ;       
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   5 3 ,   d a t a _ o t h e r [ 1 ] [ 0 ]   +   ( d a t a _ m a i n   = =   0   & &   d a t a _ o t h e r _ i d x   = =   1   ?   "   * "   :   " " ) ) ;       
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   5 4 ,   d a t a _ o t h e r [ 2 ] [ 0 ]   +   ( d a t a _ m a i n   = =   0   & &   d a t a _ o t h e r _ i d x   = =   2   ?   "   * "   :   " " ) ) ;   
 
         
 
         v a r   m e t a _ a l b u m _ t x t   =   m e t a _ a l b u m   ?   ( m e t a _ a l b u m . l e n g t h   > =   2 5   ?   m e t a _ a l b u m . s u b s t r ( 0 ,   2 5 )   +   "   . . . "   :   m e t a _ a l b u m )   :   "   . . . " ; 
 
         
 
         M F _ S T R I N G   =   m e t a _ a l b u m   ?     M F _ E N A B L E D   :   M F _ G R A Y E D ;       
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   5 5 ,   d a t a _ o t h e r [ 3 ] [ 0 ]   +   "   "   +   m e t a _ a l b u m _ t x t   +   ( d a t a _ m a i n   = =   0   & &   d a t a _ o t h e r _ i d x   = =   3   ?   "   * "   :   " " ) ) ; 
 
 
 
         v a r   m e t a _ t i t l e _ t x t   =   m e t a _ t i t l e   ?   ( m e t a _ t i t l e . l e n g t h   > =   2 5   ?   m e t a _ t i t l e . s u b s t r ( 0 ,   2 5 )   +   "   . . . "   :   m e t a _ t i t l e )   :   "   . . . " ; 
 
         
 
         M F _ S T R I N G   =   m e t a _ t i t l e   ?     M F _ E N A B L E D   :   M F _ G R A Y E D ;       
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   5 6 ,   d a t a _ o t h e r [ 4 ] [ 0 ]   +   "   "   +   m e t a _ t i t l e _ t x t   +   ( d a t a _ m a i n   = =   0   & &   d a t a _ o t h e r _ i d x   = =   4   ?   "   * "   :   " " ) ) ; 
 
 
 
         i f   ( d a t a _ m a i n   = =   1 ) { 
 
                 _ m e n u . C h e c k M e n u R a d i o I t e m ( 5 2 ,   5 5   ,   d a t a _ o t h e r _ i d x   +   5 2 ) ;       
 
                 _ m e n u . E n a b l e M e n u I t e m ( d a t a _ o t h e r _ i d x   +   5 2 ,   1 ) ;   
 
         } 
 
 
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S E P A R A T O R ,   0 ,   0 ) ;       
 
         M F _ S T R I N G   =   m e t a _ a r t i s t   ?   M F _ E N A B L E D   :   M F _ G R A Y E D ; 
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   6 0 ,   " l a s t . f m   :   "   +   a r t i s t _ t x t ) ; 
 
         
 
         s w i t c h ( d a t a _ o t h e r _ i d x )   { 	 	 	 	 	 	 
 
         c a s e   3 : 	 
 
                 l a s t _ f m _ t e x t   =   m e t a _ a l b u m _ t x t ; 	 
 
                 b r e a k ; 
 
         c a s e   4 : 
 
                 l a s t _ f m _ t e x t   =   m e t a _ t i t l e _ t x t ; 	 
 
                 b r e a k ; 
 
         } 
 
 
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   6 1 ,   " l a s t . f m   :   "   +   ( d a t a _ o t h e r _ i d x   = =   3   | |   d a t a _ o t h e r _ i d x   = =   4   ?   l a s t _ f m _ t e x t   :   d a t a _ o t h e r [ d a t a _ o t h e r _ i d x ] [ 0 ] ) ) ; 
 
         
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S E P A R A T O R ,   0 ,   0 ) ; 
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   7 0 ,   " F a d e   e f f e c t " ) ; 
 
         _ m e n u . C h e c k M e n u I t e m ( 7 0 ,   f a d e _ e f f e c t ) ; 
 
         
 
         _ s e c o n d g r o u p   =   w i n d o w . C r e a t e P o p u p M e n u ( ) ;   
 
         _ s e c o n d g r o u p . A p p e n d T o ( _ m e n u , M F _ E N A B L E D ,   " S e a r c h   b y   :   "   +   s e a r c h _ b y [ s e a r c h _ b y _ i d x ] ) ; 
 
         _ s e c o n d g r o u p . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   8 0 ,   s e a r c h _ b y [ 0 ] ) ; 
 
         _ s e c o n d g r o u p . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   8 1 ,   s e a r c h _ b y [ 1 ] ) ; 
 
         _ s e c o n d g r o u p . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   8 2 ,   s e a r c h _ b y [ 2 ] ) ; 
 
         _ s e c o n d g r o u p . C h e c k M e n u R a d i o I t e m ( 8 0 ,   8 1 ,   s e a r c h _ b y _ i d x   +   8 0 ) ; 
 
         _ s e c o n d g r o u p . E n a b l e M e n u I t e m ( s e a r c h _ b y _ i d x   +   8 0 ,   1 ) ;       
 
 
 
         _ t h i r d g r o u p   =   w i n d o w . C r e a t e P o p u p M e n u ( ) ; 
 
         _ t h i r d g r o u p . A p p e n d T o ( _ m e n u , M F _ E N A B L E D ,   " A l i g n   :   "   +   a l i g n _ m o d e _ a [ a l i g n _ m o d e ] ) ; 
 
         _ t h i r d g r o u p . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   9 0 ,   a l i g n _ m o d e _ a [ 0 ] ) ; 
 
         _ t h i r d g r o u p . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   9 1 ,   a l i g n _ m o d e _ a [ 1 ] ) ; 
 
         _ t h i r d g r o u p . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   9 2 ,   a l i g n _ m o d e _ a [ 2 ] ) ; 
 
         _ t h i r d g r o u p . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   9 3 ,   a l i g n _ m o d e _ a [ 3 ] ) ; 
 
         _ t h i r d g r o u p . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   9 4 ,   a l i g n _ m o d e _ a [ 4 ] ) ; 
 
         _ t h i r d g r o u p . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   9 5 ,   a l i g n _ m o d e _ a [ 5 ] ) ; 
 
         _ t h i r d g r o u p . C h e c k M e n u R a d i o I t e m ( 9 0 ,   8 5 ,   a l i g n _ m o d e   +   9 0 ) ; 
 
         _ t h i r d g r o u p . E n a b l e M e n u I t e m ( a l i g n _ m o d e   +   9 0 ,   1 ) ; 
 
 
 
         _ f o u r t h g r o u p   =   w i n d o w . C r e a t e P o p u p M e n u ( ) ; 
 
         _ f o u r t h g r o u p . A p p e n d T o ( _ m e n u , M F _ E N A B L E D ,   " D o w n l o a d   q u a l i t y   :   "   +   q u a l i t y [ d o w n l o a d _ q u a l i t y ] [ 0 ] ) ; 
 
         _ f o u r t h g r o u p . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   1 0 0 ,   q u a l i t y [ 0 ] [ 0 ] ) ; 
 
         _ f o u r t h g r o u p . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   1 0 1 ,   q u a l i t y [ 1 ] [ 0 ] ) ; 
 
         _ f o u r t h g r o u p . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   1 0 2 ,   q u a l i t y [ 2 ] [ 0 ] ) ; 
 
         _ f o u r t h g r o u p . C h e c k M e n u R a d i o I t e m ( 1 0 0 ,   1 0 2 ,   d o w n l o a d _ q u a l i t y   +   1 0 0 ) ; 
 
         _ f o u r t h g r o u p . E n a b l e M e n u I t e m ( d o w n l o a d _ q u a l i t y   +   1 0 0 ,   1 ) ; 
 
 
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S E P A R A T O R ,   0 ,   0 ) ; 
 
         _ f i f t h g r o u p   =   w i n d o w . C r e a t e P o p u p M e n u ( ) ; 
 
         M F _ S T R I N G   =   i m a g e s . l e n g t h   >   0   ?   M F _ E N A B L E D   :   M F _ G R A Y E D ; 
 
         _ f i f t h g r o u p . A p p e n d T o ( _ m e n u , M F _ S T R I N G ,   " C o p y   t o   f o l d e r   c o n t a i n i n g   t r a c k   . . . " ) ; 
 
         _ f i f t h g r o u p . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 1 0 ,   " C o p y   f i l e " ) ; 
 
         _ f i f t h g r o u p . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 1 1 ,   " C o p y   f i l e s " ) ; 
 
         
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 2 0 ,   " O p e n   i m a g e " ) ; 
 
         
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S E P A R A T O R ,   0 ,   0 ) ; 
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   1 3 0 ,   " S a v e   i m a g e s   a n d   t e x t " ) ; 
 
         _ m e n u . C h e c k M e n u I t e m ( 1 3 0 ,   s a v e _ i m a g e s ) ; 
 
         
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   1 4 0 ,   " D e l e t e   e m p t y   f o l d e r s " ) ; 
 
         
 
         i f   ( m i _ r e f r e s h ) { 
 
                 _ m e n u . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   1 5 0 ,   " R e f r e s h " ) ; 
 
         } 
 
 
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S E P A R A T O R ,   0 ,   0 ) ;   
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   5 1 0 ,   " P r o p e r t i e s " ) ;       
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ E N A B L E D ,   5 2 0 ,   " C o n f i g u r e   . . . " ) ; 
 
         
 
         r e t   =   _ m e n u . T r a c k P o p u p M e n u ( x   +   2 0 ,   y   -   2 5 0 ) ; 
 
 
 
         s w i t c h   ( t r u e )   { 
 
                 c a s e   ( r e t   > =   1   & &   r e t   <   l a n g _ a r r . l e n g t h   +   1 ) : 
 
                 l a n g _ i d x   =   r e t   -   1 ; 
 
                 w i n d o w . S e t P r o p e r t y ( " l a n g " ,   l a n g _ i d x ) ; 
 
                 g e t _ t e x t ( ) ; 
 
                 b r e a k ; 
 
         } 
 
         
 
         s w i t c h   ( t r u e )   { 
 
                 c a s e   ( r e t   > =   2 0   & &   r e t   <   l a n g u a g e _ t e x t . l e n g t h   +   2 0 ) : 
 
                 t m p _ l a n g _ i d x   =   l a n g _ a r r [ l a n g _ i d x ] ; 
 
                 v a r   t m p   =   w i n d o w . G e t P r o p e r t y ( l a n g u a g e _ t e x t [ r e t   -   2 0 ] [ 0 ] ) ; 
 
                 w i n d o w . S e t P r o p e r t y ( l a n g u a g e _ t e x t [ r e t   -   2 0 ] [ 0 ] ,   ! t m p ) ; 
 
                 c r e a t e _ l a n g _ a r r ( ) ; 
 
                 o n _ m o u s e _ r b t n _ u p   ( x ,   y ) ; 
 
                 b r e a k ; 
 
         } 
 
 
 
         s w i t c h   ( r e t )   { 
 
         c a s e   4 0 : 
 
         c a s e   4 1 : 
 
                 o l d _ a l b u m   =   " " ; 
 
                 i l d _ t i t l e   =   " " ; 
 
                 s e l e c t i o n _ m o d e   =   r e t   -   4 0 ; 
 
                 w i n d o w . S e t P r o p e r t y ( " s e l e c t i o n   m o d e " ,   s e l e c t i o n _ m o d e ) ; 
 
                 o n _ i t e m _ f o c u s _ c h a n g e ( ) ; 
 
                 b r e a k ; 
 
         c a s e   5 0 : 
 
         c a s e   5 1 : 
 
                 d a t a _ m a i n   =   r e t   -   5 0 ; 
 
                 w i n d o w . S e t P r o p e r t y ( " d a t a _ m a i n :   b i o   o r   a l b u m ,   s i m i l a r " ,   d a t a _ m a i n ) ;   
 
                 g e t _ i m g ( m e t a _ a r t i s t ,   m e t a _ a l b u m ,   m e t a _ t i t l e ) ; 
 
                 b r e a k ; 
 
         c a s e   5 2 : 
 
         c a s e   5 3 : 
 
         c a s e   5 4 : 
 
         c a s e   5 5 : 
 
         c a s e   5 6 : 
 
                 d a t a _ o t h e r _ i d x   =   r e t   -   5 2 ; 
 
                 w i n d o w . S e t P r o p e r t y ( " d a t a _ o t h e r _ i d x " ,   d a t a _ o t h e r _ i d x ) ; 
 
                 i f   ( d a t a _ m a i n   = =   0 )   { 
 
                         d a t a _ m a i n   =   1 ; 
 
                         w i n d o w . S e t P r o p e r t y ( " d a t a _ m a i n :   b i o   o r   a l b u m ,   s i m i l a r " ,   d a t a _ m a i n ) ;   
 
                 } 
 
                 g e t _ i m g ( m e t a _ a r t i s t ,   m e t a _ a l b u m ,   m e t a _ t i t l e ) ; 
 
                 b r e a k ; 
 
         c a s e   6 0 : 
 
                 W s h S h e l l . r u n ( " h t t p s : / / w w w . l a s t . f m / "   +   l a n g _ q u e r y ( l a n g _ i d x )   +   " m u s i c / "   +   e n c o d e U R I C o m p o n e n t ( m e t a _ a r t i s t ) ) ; 
 
                 b r e a k ; 
 
         c a s e   6 1 : 
 
                 s w i t c h ( d a t a _ o t h e r _ i d x )   { 	 	 	 	 	 	 
 
                 c a s e   0 : 	 	 	 	 	 	 
 
                 c a s e   1 : 	 	 	 	 	 	 
 
                 c a s e   2 : 	 	 	 	 	 	 
 
                         W s h S h e l l . r u n ( " h t t p s : / / w w w . l a s t . f m / "   +   l a n g _ q u e r y ( l a n g _ i d x )   +   " m u s i c / "   +   e n c o d e U R I C o m p o n e n t ( m e t a _ a r t i s t )   +   " / + "   +   d a t a _ o t h e r [ d a t a _ o t h e r _ i d x ] [ 1 ] ) ; 
 
                         b r e a k ; 	 
 
                 c a s e   3 : 	 	 	 	 	 	 
 
                         W s h S h e l l . r u n ( " h t t p s : / / w w w . l a s t . f m / "   +   l a n g _ q u e r y ( l a n g _ i d x )   +   " m u s i c / "   +   e n c o d e U R I C o m p o n e n t ( m e t a _ a r t i s t )   +   " / "   +   e n c o d e U R I C o m p o n e n t ( m e t a _ a l b u m ) ) ; 
 
                         b r e a k ; 
 
                 c a s e   4 : 	 	 	 	 	 	 
 
                         W s h S h e l l . r u n ( " h t t p s : / / w w w . l a s t . f m / "   +   l a n g _ q u e r y ( l a n g _ i d x )   +   " m u s i c / "   +   e n c o d e U R I C o m p o n e n t ( m e t a _ a r t i s t )   +   " / "   +   ( m e t a _ a l b u m   ?   e n c o d e U R I C o m p o n e n t ( m e t a _ a l b u m )   +   " / "   :   " _ / " )   +   e n c o d e U R I C o m p o n e n t ( m e t a _ t i t l e ) ) ; 
 
                         b r e a k ; 
 
               } 
 
                 b r e a k ; 
 
         c a s e   7 0 : 
 
                 w i n d o w . S e t P r o p e r t y ( " f a d e   e f f e c t " ,   ! f a d e _ e f f e c t ) ; 
 
                 f a d e _ e f f e c t   =   w i n d o w . G e t P r o p e r t y ( " f a d e   e f f e c t " ) ; 
 
                 b r e a k ; 
 
         c a s e   8 0 : 
 
         c a s e   8 1 : 
 
         c a s e   8 2 : 
 
                 s e a r c h _ b y _ i d x   =   r e t   -   8 0 ; 
 
                 w i n d o w . S e t P r o p e r t y ( " s e a r c h   b y   i d x " ,   s e a r c h _ b y _ i d x ) ; 
 
                 o n _ i t e m _ f o c u s _ c h a n g e ( ) ; 
 
                 b r e a k ; 
 
         c a s e   9 0 : 
 
         c a s e   9 1 : 
 
         c a s e   9 2 :   
 
         c a s e   9 3 : 
 
         c a s e   9 4 : 
 
         c a s e   9 5 : 
 
                 a l i g n _ m o d e   =   r e t   -   9 0 ; 
 
                 w i n d o w . S e t P r o p e r t y ( " a l i g n   m o d e " ,   a l i g n _ m o d e ) ; 
 
                 w i n d o w . R e p a i n t ( ) ; 
 
                 b r e a k ; 
 
         c a s e   1 0 0 : 
 
         c a s e   1 0 1 : 
 
         c a s e   1 0 2 :         
 
                 d o w n l o a d _ q u a l i t y   =   r e t   -   1 0 0 ; 
 
                 w i n d o w . S e t P r o p e r t y ( " d o w n l o a d   q u a l i t y " ,   d o w n l o a d _ q u a l i t y ) ; 
 
                 r e f r e s h _ d a t a   =   t r u e ; 
 
                 o n _ m e t a d b _ c h a n g e d ( ) ; 
 
                 b r e a k ; 
 
         c a s e   1 1 0 : 
 
                 c o p y _ f i l e s ( 0 ) ; 
 
                 b r e a k ; 
 
         c a s e   1 1 1 : 
 
                 c o p y _ f i l e s ( 1 ) ; 
 
                 b r e a k ; 
 
         c a s e   1 2 0 : 
 
                 t r y   { 
 
                         s w i t c h ( d a t a _ m a i n )   { 	 	 	 	 	 	 
 
                         c a s e   0 : 	 	 	 	 	 	 
 
                                 i f   ( i m a g e s [ s e l e c t e d ] )   W s h S h e l l . r u n (   ' " '   +   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t ) +   " \ \ "   +   m e t a _ a r t i s t   +   " _ "     +   s e l e c t e d   +   " _ "   +   " a r t i s t "   +   " . j p g "   +   ' " '   ) ; 	 	 	 	 	 
 
                                 b r e a k ; 	 	 	 	 	 	 
 
                         c a s e   1 : 	 
 
                                 s w i t c h ( d a t a _ o t h e r _ i d x )   { 	 	 	 	 	 	 
 
                                 c a s e   0 : 	 	 	 	 	 	 
 
                                 c a s e   1 : 
 
                                         v a r   a l b u m   =   u t i l s . R e a d I N I (   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t )   +   " \ \ "   +   m e t a _ a r t i s t   +   " _ a l b u m _ i n f o . i n i " ,   d a t a _ o t h e r [ d a t a _ o t h e r _ i d x ] [ 2 ]   +   "   :   n a m e "   ,   s e l e c t e d   ) ; 	 
 
                                         i f   ( i m a g e s [ s e l e c t e d ] )   W s h S h e l l . r u n (   ' " '   +   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t ) +   " \ \ "   +   m e t a _ a r t i s t   +   " _ "     + c l e a n ( a l b u m )   +   " . j p g "   +   ' " '   ) ; 	 	 	 
 
                                         b r e a k ; 
 
                                 c a s e   2 : 	 
 
                                 i f   ( i m a g e s [ s e l e c t e d ] )   W s h S h e l l . r u n (   ' " '   +   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t ) +   " \ \ "   +   m e t a _ a r t i s t   +   " _ "     +   s e l e c t e d   +   " _ "   +   " s i m i l a r "   +   " . j p g "   +   ' " '   ) ; 	 	 	 	 	 
 
                                 b r e a k ; 	 
 
                                 c a s e   3 : 	 	 	 	 	 	 
 
                                         i f   ( i m a g e s [ s e l e c t e d ] )   W s h S h e l l . r u n (   ' " '   +   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t )   +   " \ \ "   +   m e t a _ a r t i s t   +   " _ "   +   m e t a _ a l b u m   +   " . j p g "   +   ' " '   ) ; 	 	 	 	 	 	 	 
 
                                         b r e a k ; 
 
                                 c a s e   4 : 
 
                                         v a r   a l b u m   =   u t i l s . R e a d I N I (   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t )   +   " \ \ "   +   m e t a _ a r t i s t   +   " _ t i t l e _ i n f o . i n i " ,   c l e a n _ i n i ( m e t a _ t i t l e ) ,   0 ) ; 
 
                                         i f   ( i m a g e s [ s e l e c t e d ] )   W s h S h e l l . r u n (   ' " '   +   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t )   +   " \ \ "   +   m e t a _ a r t i s t   +   " _ "   +   c l e a n ( a l b u m )   +   " . j p g "   +   ' " '   ) ; 	 
 
                                         b r e a k ; 
 
                                 } 
 
                                 b r e a k ;                 
 
                         } 	 
 
                 }   c a t c h ( e )   { } ; 
 
                 b r e a k ; 
 
         c a s e   1 3 0 : 
 
                 w i n d o w . S e t P r o p e r t y ( " S a v e   i m a g e s " ,   ! s a v e _ i m a g e s ) ; 
 
                 s a v e _ i m a g e s   =   w i n d o w . G e t P r o p e r t y ( " S a v e   i m a g e s " ) ; 
 
                 b r e a k ; 
 
         c a s e   1 4 0 : 
 
                 d e l e t e _ e m p t y _ f o l d e r s ( ) ; 
 
                 b r e a k ; 
 
         c a s e   1 5 0 : 
 
                 r e f r e s h _ d a t a   =   t r u e ; 
 
                 o n _ m e t a d b _ c h a n g e d ( ) ; 
 
                 b r e a k ; 
 
         c a s e   5 0 0 : 
 
                 t r y   { 
 
                         w i n d o w . R e l o a d ( ) ; 
 
                 }   c a t c h ( e )   { } ; 
 
                 b r e a k ; 
 
         c a s e   5 1 0 : 
 
                 w i n d o w . S h o w P r o p e r t i e s ( ) ; 
 
                 b r e a k ;       
 
         c a s e   5 2 0 : 
 
                 w i n d o w . S h o w C o n f i g u r e ( ) ;       
 
                 b r e a k ;     
 
       } 
 
         _ m e n u . D i s p o s e ( ) ;       	 	 	 	 
 
         r e t u r n   t r u e ;       	 	 	 	 
 
 }       	 	 	 	 
 
 	 	 	 	 
 
 v a r   t i m e r ; 	 
 
 	 
 
 f u n c t i o n   g e t _ f i l e s _ i f _ l o a d e d ( p ,   t _ a r t i s t ,   t _ a l b u m ,   t _ t i t l e ) { 	 
 
         v a r   i   =   0 ; 
 
         t i m e r   & &   w i n d o w . C l e a r I n t e r v a l ( t i m e r ) ;   
 
         t i m e r   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n ( )   { 	 
 
                 i + + ; 
 
                 g e t _ i m g _ f i l e s _ f r o m _ d i r ( p ,   t _ a r t i s t ,   t _ a l b u m ,   t _ t i t l e ) ; 
 
                 i f   ( i m a g e s . l e n g t h   >   0   | |   i   > =   2 0 )   { 
 
                         n e x t _ i m a g e ( 0 ) ; 
 
                         g e t _ t e x t ( ) ; 
 
                         w i n d o w . C l e a r I n t e r v a l ( t i m e r ) ;   
 
                 }                                   	 	 	 	 
 
         } ,   5 0 0 ) ; 
 
 } 
 
 
 
 v a r   s e t _ c y c l e   =   f a l s e ; 
 
 
 
 f u n c t i o n   o n _ k e y _ d o w n ( v k e y )   { 
 
         s w i t c h ( v k e y ) { 
 
         c a s e   V K _ S H I F T : 
 
                 s e t _ c y c l e   =   t r u e ; 
 
                 w i n d o w . R e p a i n t ( ) ; 
 
                 b r e a k ; 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   o n _ k e y _ u p ( v k e y )   { 
 
         s w i t c h ( v k e y ) { 
 
         c a s e   V K _ S H I F T : 
 
                 s e t _ c y c l e   =   f a l s e ;   
 
                 i f   ( c y c l e   >   0 )   s e t _ c y c l e _ t i m e r ( ) ; 
 
                 i f   ( c y c l e   = =   0 )   w i n d o w . C l e a r I n t e r v a l ( c y c l e _ t i m e r ) ; 
 
                 w i n d o w . R e p a i n t ( ) ;   
 
                 b r e a k ; 
 
         } 
 
 } 
 
 
 
 v a r   c y c l e _ t i m e r ,   s t e p   =   0 ; 
 
 
 
 f u n c t i o n   s e t _ c y c l e _ t i m e r ( ) { 
 
     c y c l e _ t i m e r   & &   w i n d o w . C l e a r I n t e r v a l ( c y c l e _ t i m e r ) ; 
 
     c y c l e _ t i m e r   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n ( )   { 
 
                 s t e p   =     s e t _ c y c l e   ?   0   :   s t e p   +   1 ; 
 
                 i f   ( c y c l e   >   0   & &   s t e p   > =   c y c l e ) { 
 
                         g e t _ i m g _ f i l e s _ f r o m _ d i r ( a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t ) ,   m e t a _ a r t i s t ) ; 	 	 	 
 
                         i f   ( i m a g e s . l e n g t h   >   1 ) { 	 	 	 
 
                                 n e x t _ i m a g e ( 1 ) ; 	 	 	 
 
                                 s t e p   =   0 ; 	 	 	 
 
                         } 	 	 	 
 
                 } 	 	 	 
 
                 w i n d o w . R e p a i n t ( ) ;   	 	 	 
 
     } ,   1 0 0 0 ) ; 	 	 	 
 
 } 	 	 	 
 
 	 	 	 
 
 v a r   d e l a y   =   f a l s e ; 	 	 	 
 
 	 	 	 
 
 f u n c t i o n   f d e l a y ( ) { 	 	 	 
 
         v a r   d e l a y _ t i m e r   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 	 	 	 
 
                 d e l a y   =   f a l s e ; 	 	 	 
 
                 w i n d o w . C l e a r T i m e o u t ( d e l a y _ t i m e r ) ; 	 	 	 
 
         } ,   2 0 0 ) ; 
 
 } 
 
 
 
 v a r   f t i m e r ; 
 
 
 
 f u n c t i o n   f a d e r _ t i m e r ( ) { 
 
     f t i m e r   & &   w i n d o w . C l e a r I n t e r v a l ( f t i m e r ) ; 
 
     f t i m e r   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n ( )   { 
 
                 / / f a d e r   =   f a d e r   *   2 ; 
 
                 i f   ( ( ! d e f a u l t _ i m g   & &   f a d e r _ l o g o   = =   0 )   | |   ( d e f a u l t _ i m g   & &   f a d e r _ d e f _ i m g   = =   0 ) ) {   
 
                         f a d e r   =   f a d e r   *   2 ; 
 
                         w i n d o w . R e p a i n t ( ) ;   
 
                         f a d e r   =   f a d e r   = =   0   ?   1   :   f a d e r ; 
 
                         i f   ( f a d e r   > =   2 5 5 )   { 
 
                                 f a d e r   =   2 5 5 ; 
 
                                 w i n d o w . C l e a r I n t e r v a l ( f t i m e r ) ; 
 
                         } 
 
                 } 
 
     } ,   4 0 ) ; 
 
 } 
 
 
 
 v a r   f a d e r _ l o g o   =   l o g o _ i m g _ t r a n s p a r e n c e ; 
 
 v a r   f t i m e r _ l o g o ; 
 
 
 
 f u n c t i o n   f a d e r _ t i m e r _ l o g o _ o f f ( ) { 
 
     f t i m e r _ l o g o   & &   w i n d o w . C l e a r I n t e r v a l ( f t i m e r _ l o g o ) ; 
 
     f t i m e r _ l o g o   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n ( )   { 
 
                 f a d e r _ l o g o   =   f a d e _ e f f e c t   ?   f a d e r _ l o g o   -   2 5   :   0 ; 
 
                 w i n d o w . R e p a i n t ( ) ;   
 
                 i f   ( f a d e r _ l o g o   < =   0 )   { 
 
                         f a d e r _ l o g o   =   0 ; 
 
                         w i n d o w . C l e a r I n t e r v a l ( f t i m e r _ l o g o ) ; 
 
                 } 
 
     } ,   4 0 ) ; 
 
 } 
 
 
 
 f u n c t i o n   f a d e r _ t i m e r _ l o g o _ o n ( ) { 
 
     f t i m e r _ l o g o   & &   w i n d o w . C l e a r I n t e r v a l ( f t i m e r _ l o g o ) ; 
 
     f t i m e r _ l o g o   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n ( )   { 
 
                 f a d e r _ l o g o   =   f a d e _ e f f e c t   ?   f a d e r _ l o g o   +   2 5   :   0 ; 
 
                 w i n d o w . R e p a i n t ( ) ;   
 
                 i f   ( f a d e r _ l o g o   > =   l o g o _ i m g _ t r a n s p a r e n c e )   { 
 
                         f a d e r _ l o g o   =   l o g o _ i m g _ t r a n s p a r e n c e ; 
 
                         w i n d o w . C l e a r I n t e r v a l ( f t i m e r _ l o g o ) ; 
 
                 } 
 
     } ,   4 0 ) ; 
 
 } 
 
 
 
 v a r   f a d e r _ d e f _ i m g   =   d e f a u l t _ i m g _ t r a n s p a r e n c e ; 
 
 v a r   f t i m e r _ d e f _ i m g ; 
 
 
 
 f u n c t i o n   f a d e r _ t i m e r _ d e f _ i m g ( ) { 
 
     f t i m e r _ d e f _ i m g   & &   w i n d o w . C l e a r I n t e r v a l ( f t i m e r _ d e f _ i m g ) ; 
 
     f t i m e r _ d e f _ i m g   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n ( )   { 
 
                 f a d e r _ d e f _ i m g   =   f a d e _ e f f e c t   ?   f a d e r _ d e f _ i m g   -   2 5   :   0 ; 
 
                 w i n d o w . R e p a i n t ( ) ;   
 
                 i f   ( f a d e r _ d e f _ i m g   < =   0 )   { 
 
                         f a d e r _ d e f _ i m g   =   0 ; 
 
                         w i n d o w . C l e a r I n t e r v a l ( f t i m e r _ d e f _ i m g ) ; 
 
                 } 
 
     } ,   4 0   ) ; 
 
 } 
 
 
 
 v a r     t o o l t i p _ t i m e r ; 
 
 
 
 f u n c t i o n   i n f o _ t o o l t i p ( )   { 
 
         t o o l t i p _ o n   =   t r u e ; 
 
         t o o l t i p _ t i m e r   & &     w i n d o w . C l e a r T i m e o u t ( t o o l t i p _ t i m e r ) ; 
 
         t o o l t i p _ t i m e r   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 
 
                 t o o l t i p _ o n   =   f a l s e ; 
 
                 w i n d o w . R e p a i n t ( ) ; 
 
                 t o o l t i p _ t i m e r   & &   w i n d o w . C l e a r T i m e o u t ( t o o l t i p _ t i m e r ) ; 
 
         } ,   3 0 0 0 ) ; 
 
 } 
 
 
 
 f u n c t i o n   l o a d _ l a s t _ f m _ l o g o ( ) { 
 
         i f ( ! f s o . F i l e E x i s t s ( s c r i p t _ p a t h   +   " l a s t _ f m _ i c o . i c o " ) )   { 
 
                 v a r   u r l   =   " h t t p s : / / s t a t i c - w e b . l a s t . f m / s t a t i c / i m a g e s / f a v i c o n . 7 0 2 b 2 3 9 b 6 1 9 4 . i c o " 
 
                 v a r   f i l e   =   " \ " "   +   s c r i p t _ p a t h   +   " l a s t _ f m _ i c o . i c o "   +   " \ " " ; 
 
                 W s h S h e l l . R u n ( v b s   +   "   "   +   u r l   +   "   "   +   f i l e ,   f a l s e ) ; 
 
         } 
 
 
 
         i f ( ! f s o . F i l e E x i s t s ( s c r i p t _ p a t h   +   " f o o t e r _ l o g o . p n g " ) )   { 
 
                 v a r   u r l   =   " h t t p s : / / s t a t i c - w e b . l a s t . f m / s t a t i c / i m a g e s / f o o t e r _ l o g o . d d c f d 6 5 7 1 2 a 6 . p n g " 
 
                 v a r   f i l e   =   " \ " "   +   s c r i p t _ p a t h   +   " f o o t e r _ l o g o . p n g "   +   " \ " " ; 
 
                 W s h S h e l l . R u n ( v b s   +   "   "   +   u r l   +   "   "   +   f i l e ,   f a l s e ) ; 
 
         } 
 
 
 
         i f ( ! f s o . F i l e E x i s t s ( s c r i p t _ p a t h   +   " l o g o _ s t a t i c . p n g " ) )   { 
 
                 v a r   u r l   =   " h t t p s : / / w w w . l a s t . f m / s t a t i c / i m a g e s / l o g o _ s t a t i c . p n g ? 7 b 5 8 1 4 3 6 b 2 3 f " 
 
                 v a r   f i l e   =   " \ " "   +   s c r i p t _ p a t h   +   " l o g o _ s t a t i c . p n g "   +   " \ " " ; 
 
                 W s h S h e l l . R u n ( v b s   +   "   "   +   u r l   +   "   "   +   f i l e ,   f a l s e ) ; 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   c r e a t e _ d o w n l o a d _ f i l e ( )   { 
 
         t r y   { 
 
                 f i l e   =   f s o . C r e a t e T e x t F i l e ( s c r i p t _ p a t h   +   " d o w n l o a d . v b s "   ) 
 
               
 
                 v a r   t e x t   =       
 
                         " I f   ( W S c r i p t . A r g u m e n t s . C o u n t   < >   2 )   T h e n "   +   " \ n \ r "   +       
 
                         "       W S c r i p t . Q u i t "   +   " \ n \ r "   + 
 
                         " E n d   I f "   +   " \ n \ r "   +   " \ n \ r "   +       
 
 
 
                         " u r l   =   W S c r i p t . A r g u m e n t s ( 0 ) "   +   " \ n \ r "   +       
 
                         " f i l e   =   W S c r i p t . A r g u m e n t s ( 1 ) "   +   " \ n \ r "     +   " \ n \ r "   +       
 
 
 
                         " S e t   o b j F S O   =   C r e a t e o b j e c t ( "   +   ' " S c r i p t i n g . F i l e S y s t e m O b j e c t " '   +   " ) "   +   " \ n \ r "   +       
 
                         " I f   o b j F S O . F i l e e x i s t s ( f i l e )   T h e n "   +   " \ n \ r "   +       
 
                         "       S e t   o b j F S O   =   N o t h i n g "   +   " \ n \ r "   + 
 
                         "       W S c r i p t . Q u i t "   +   " \ n \ r "   + 
 
                         " E n d   I f "   +   " \ n \ r "   +   " \ n \ r "   +       
 
 
 
                         " S e t   o b j X M L H T T P   =   C r e a t e O b j e c t ( "   +   ' " M S X M L 2 . X M L H T T P " '   +   " ) "   +   " \ n \ r "   +       
 
                         " o b j X M L H T T P . o p e n   "   +   ' " G E T " '   +   " ,   u r l , f a l s e "   +   " \ n \ r "   +       
 
                         " o b j X M L H T T P . s e n d ( ) "   +   " \ n \ r "   +   " \ n \ r "   +       
 
 
 
                         " I f   o b j X M L H T T P . S t a t u s   =   2 0 0   T h e n "   +   " \ n \ r "   +       
 
                         "       S e t   o b j A D O S t r e a m   =   C r e a t e O b j e c t ( "   +   ' " A D O D B . S t r e a m " '   +   " ) "   +   " \ n \ r "   + 
 
                         "       o b j A D O S t r e a m . O p e n "   +   " \ n \ r "   + 
 
                         "       o b j A D O S t r e a m . T y p e   =   1 "   +   " \ n \ r "   + 
 
                         "       o b j A D O S t r e a m . W r i t e   o b j X M L H T T P . R e s p o n s e B o d y "   +   " \ n \ r "   + 
 
                         "       o b j A D O S t r e a m . P o s i t i o n   =   0 "   +   " \ n \ r "   + 
 
                         "       o b j A D O S t r e a m . S a v e T o F i l e   f i l e "   +   " \ n \ r "   + 
 
                         "       o b j A D O S t r e a m . C l o s e "   +   " \ n \ r "   + 
 
                         "       S e t   o b j A D O S t r e a m   =   N o t h i n g "   +   " \ n \ r "   + 
 
                         " E n d   I f "   +   " \ n \ r "   +   " \ n \ r "   +       
 
 
 
                         " S e t   o b j F S O   =   N o t h i n g "   +   " \ n \ r "   +       
 
                         " S e t   o b j X M L H T T P   =   N o t h i n g "       
 
                 ; 
 
 
 
                 f i l e . W r i t e L i n e ( t e x t ) ; 
 
                 f i l e . C l o s e ( ) ; 
 
         }   c a t c h ( e )   { } ; 
 
 } 
 
 
 
 f u n c t i o n   o n _ m o u s e _ m o v e ( x ,   y )   { 
 
         w i n d o w . S e t C u r s o r ( I D C _ H A N D ) ; 
 
         
 
         p o s _ x   =   x ; 
 
         p o s _ y   =   y ;   
 
 
 
         o n _ h e a d e r   =   x   > =   t x t _ x   & &   x   <   w w   & &   y   > =   t x t _ y   & &   y   <   t _ y   ?   t r u e   :   f a l s e ; 
 
         o n _ t e x t   =   x   > =   t x t _ x   & &   x   <   s c r o l l b a r _ x   & &   y   > =   t _ y   & &   y   < =   w h   ?   t r u e   :   f a l s e ; 
 
         o n _ s b   =     x   > =   s c r o l l b a r _ x   & &   x   <   w w   & &   y   > =   t _ y   & &   y   < =   w h   ?   t r u e   :   f a l s e ; 
 
         o n _ p i c   =   ! o n _ t e x t   & &   ! o n _ h e a d e r   & &   ! o n _ s b   ?   t r u e   :   f a l s e ; 
 
 
 
         i f   ( o n _ t e x t _ d o w n ) { 
 
                 t x t _ x   =   x   -   d e l t a _ x ; 
 
                 t x t _ y   =   y   -   d e l t a _ y ; 
 
 
 
                 t x t _ x   =   M a t h . m a x ( 0 ,   M a t h . m i n ( t x t _ x ,   w w   -   t _ m a r g i n   *   2   -   h 1 _ c h a r _ w i d t h   -   ( s c r o l l b a r   ?   s c r o l l b a r _ w   +   1 0   :   0 ) ) ) ; 
 
                 t x t _ y   =   M a t h . m a x ( 0 ,   M a t h . m i n ( t x t _ y ,   w h   -   ( h 1 _ t e x t _ r o w _ h e i g h t   +   t _ m a r g i n   *   2 ) ) ) ; 
 
 
 
                 g e t _ t e x t _ a r r a y ( ) ; 
 
         } 
 
 
 
         i f   ( o n _ s b _ d o w n   & &   s c r o l l b a r   & &   t e x t _ r o w s   >   t e x t _ v i s a b l e _ r o w s ) { 
 
                 s b _ p o s y   =   y   +   d e l t a _ y ; 
 
                 s _ t e x t   =   y   +   d e l t a _ y   > =   0   ?   y   +   d e l t a _ y   < =   ( t e x t _ r o w s   -   t e x t _ v i s a b l e _ r o w s )   *   s c r o l l b a r _ k   ?   M a t h . r o u n d ( s b _ p o s y   /   s c r o l l b a r _ k )   :   t e x t _ r o w s   -   t e x t _ v i s a b l e _ r o w s   :   0 ; 	 	 	 	 	 	 	 
 
                 w i n d o w . R e p a i n t R e c t ( t x t _ x ,   t x t _ y ,   w w   -   t x t _ x ,   w h   -   t x t _ y ) ; 	 	 	 	 	 	 	 
 
         } 	 	 	 	 	 	 	 
 
         	 	 	 	 	 	 	 
 
         i f   ( o n _ h e a d e r   & &   o n _ t e x t _ d o w n )   { 	 	 	 	 	 	 	 
 
                 t e x t _ h i d e n   =   f a l s e ; 	 	 	 	 	 	 	 
 
                 w i n d o w . S e t P r o p e r t y ( " t x t   h i d e n " ,   t e x t _ h i d e n ) ; 	 	 	 	 	 	 	 
 
         } 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
         w i n d o w . R e p a i n t R e c t ( s c r o l l b a r _ x ,   t x t _ y ,   w w ,   w h ) ; 	 	 	 	 	 	 	 
 
         i f   ( t o o l t i p _ o n )   w i n d o w . R e p a i n t ( ) ; 	 	 	 	 	 	 	 
 
 } 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
 f u n c t i o n   o n _ m o u s e _ w h e e l ( d e l t a )   { 	 	 	 	 	 	 	 
 
         S h i f t D o w n   =   u t i l s . I s K e y P r e s s e d ( V K _ S H I F T )   ?   t r u e   :   f a l s e ; 	 	 	 	 	 	 	 
 
         C o n t r o l t D o w n   =   u t i l s . I s K e y P r e s s e d ( V K _ C O N T R O L )   ?   t r u e   :   f a l s e ; 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
         i f   ( o n _ p i c   & &   ! s e t _ c y c l e   & &   ! d e l a y ) { 	 
 
                 i f   ( i m a g e s . l e n g t h   <   l i m i t )   g e t _ i m g _ f i l e s _ f r o m _ d i r ( a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t ) ,   m e t a _ a r t i s t ) ; 	                 
 
                 i f   ( f i l e s . l e n g t h   >   1 ) { 	 	 	 	 	 	 	 
 
                         d e l a y   =   t r u e ; 	 	 	 	 	 	 	 
 
                         f d e l a y ( ) ; 	 	 	 	 	 	 	 
 
                         n e x t _ i m a g e ( d e l t a ) ; 	 	 	 	 	 	 	 
 
                         i f   ( c y c l e   >   0 )   s t e p   =   0 ; 	 	 	 	 	 	 	 
 
                 } 	 	 	 	 	 	 	 
 
         } 	 	 	 	 	 	 	 
 
       	 	 	 	 	 	 	 
 
         i f   ( ( o n _ h e a d e r   | |   o n _ t e x t   | |   o n _ s b )   & &   ! S h i f t D o w n   & &   ! C o n t r o l t D o w n ) { 	 	 	 	 	 	 	 
 
                 i f   ( t e x t _ r o w s   >   t e x t _ v i s a b l e _ r o w s ) { 	 	 	 	 	 	 	 
 
                         i f   ( d e l t a   <   0 )   { s _ t e x t   =   t e x t _ r o w s   -   s _ t e x t   < =   t e x t _ v i s a b l e _ r o w s   ?   t e x t _ r o w s   -   t e x t _ v i s a b l e _ r o w s   :   s _ t e x t   + =   1 } 	 	 	 	 	 	 	 
 
                         i f   ( d e l t a   >   0 )   { s _ t e x t   =   s _ t e x t   < =   0   ?   0   :   s _ t e x t   - =   1 } 	 	 	 	 	 	 	 
 
                 } 	 	 	 	 	 	 	 
 
                 w i n d o w . R e p a i n t R e c t ( t x t _ x ,   t x t _ y ,   w w   -   t x t _ x ,   w h   -   t x t _ y ) ; 	 	 	 	 	 	 	 
 
         } 	 	 	 	 	 	 	 
 
       	 	 	 	 	 	 	 
 
         i f   ( ( o n _ h e a d e r   | |   o n _ t e x t )   & &   S h i f t D o w n   & &   ! d e l a y   & &   ! C o n t r o l t D o w n ) { 	 	 	 	 	 	 	 
 
                 d e l a y   =   t r u e ; 	 	 	 	 	 	 	 
 
                 f d e l a y ( ) ; 	 	 	 	 	 	 	 
 
                 	 	 	 	 	 	 	 
 
                 i f   ( o n _ h e a d e r   & &   d e l t a   <   0 )   { f o n t _ s i z e _ h   =   M a t h . m a x ( m i n _ f o n t _ s i z e ,   f o n t _ s i z e _ h   - =   1 ) } ; 	 	 	 	 	 	 	 
 
                 i f   ( o n _ h e a d e r   & &   d e l t a   >   0 )   { f o n t _ s i z e _ h   =   M a t h . m i n ( m a x _ f o n t _ s i z e ,   f o n t _ s i z e _ h   + =   1 ) } ; 	 	 	 	 	 	 	 
 
                 w i n d o w . S e t P r o p e r t y ( " f o n t   s i z e :   h e a d e r " ,   f o n t _ s i z e _ h ) ; 	 	 	 	 	 	 	 
 
                 i f   ( o n _ t e x t   & &   d e l t a   <   0 )   { f o n t _ s i z e _ t   =   M a t h . m a x ( m i n _ f o n t _ s i z e ,   f o n t _ s i z e _ t   - =   1 ) } ; 	 	 	 	 	 	 	 
 
                 i f   ( o n _ t e x t   & &   d e l t a   >   0 )   { f o n t _ s i z e _ t   =   M a t h . m i n ( m a x _ f o n t _ s i z e ,   f o n t _ s i z e _ t   + =   1 ) } ; 	 	 	 	 	 	 	 
 
                 w i n d o w . S e t P r o p e r t y ( " f o n t   s i z e :   t e x t " ,   f o n t _ s i z e _ t ) ; 	 	 	 	 	 	 	 
 
                 	 	 	 	 	 	 	 
 
                 g e t _ f o n t ( ) ; 	 	 	 	 	 	 	 
 
                 r e f r e s h _ t x t   =   t r u e ; 	 	 	 	 	 	 	 
 
                 g e t _ t e x t _ a r r a y ( ) ; 	 	 	 	 	 	 	 
 
         } 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
         i f   ( ( o n _ h e a d e r   | |   o n _ t e x t )   & &   ! S h i f t D o w n   & &   C o n t r o l t D o w n ) { 	 	 	 	 	 	 	 
 
                 i f   ( d e l t a   <   0 )   { b g _ t r a n s p a r e n c e   =   M a t h . m a x ( 0 ,   b g _ t r a n s p a r e n c e   - =   1 0 ) } ; 	 	 	 	 	 	 	 
 
                 i f   ( d e l t a   >   0 )   { b g _ t r a n s p a r e n c e   =   M a t h . m i n ( 2 5 5 ,   b g _ t r a n s p a r e n c e   + =   1 0 ) } ;   	 	 	 	 	 	 	 
 
                 w i n d o w . S e t P r o p e r t y ( " t e x t   b g   t r a n s p a r e n c e   ( 0 - 2 5 5 ) " ,   b g _ t r a n s p a r e n c e ) ; 	 	 	 	 	 	 	 
 
                 w i n d o w . R e p a i n t ( ) ; 	 	 	 	 	 	 	 
 
         } 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
         i f   ( o n _ p i c   & &   s e t _ c y c l e   & &   S h i f t D o w n )   { 	 	 	 	 	 	 	 
 
                 i f   ( d e l t a   <   0 )   { c y c l e   =   c y c l e   < =   0   ?   0   :   c y c l e   -   5 ; } ; 	 	 	 	 	 	 	 
 
                 i f   ( d e l t a   >   0 )   { c y c l e   =   c y c l e   > =   6 0   ?   6 0   :   c y c l e   +   5 ; } ; 	 	 	 	 	 	 	 
 
                 w i n d o w . S e t P r o p e r t y ( " a u t o   c y c l e   ( s e c ) " ,   c y c l e ) ; 	 	 	 	 	 	 	 
 
                 w i n d o w . R e p a i n t ( ) ; 	 	 	 	 	 	 	 
 
         } 	 	 	 	 	 	 	 
 
 } 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
 f u n c t i o n   o n _ m o u s e _ l b t n _ d o w n ( x , y ) { 	 	 	 	 	 	 	 
 
         i f   ( o n _ h e a d e r   | |   o n _ t e x t ) { 	 	 	 	 	 	 	 
 
                 o n _ t e x t _ d o w n   =   t r u e ; 	 	 	 	 	 	 	 
 
                 d e l t a _ x   =   x   -   t x t _ x ; 	 	 	 	 	 	 	 
 
                 d e l t a _ y   =   y   -   t x t _ y ; 	 	 	 	 	 	 	 
 
         } 
 
         i f   ( o n _ s b ) { 
 
                 o n _ s b _ d o w n   =   t r u e ; 
 
                 s b _ p o s y   =   s _ t e x t   *   s c r o l l b a r _ k ; 
 
                 d e l t a _ y   =   s b _ p o s y   -   y ; 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   o n _ m o u s e _ l b t n _ u p ( x , y ) { 
 
         w i n d o w . S e t P r o p e r t y ( " t x t _ x " ,   t x t _ x ) ; 
 
         w i n d o w . S e t P r o p e r t y ( " t x t _ y " ,   t x t _ y ) ; 
 
         o n _ t e x t _ d o w n   =   f a l s e ; 
 
         o n _ s b _ d o w n   =   f a l s e ; 
 
 } 
 
 
 
 f u n c t i o n   o n _ m o u s e _ l b t n _ d b l c l k   ( x , y ) { 
 
         i f   ( o n _ t e x t   & &   l a n g _ a r r . l e n g t h   >   0 ) { 
 
                 
 
                 S h i f t D o w n   =   u t i l s . I s K e y P r e s s e d ( 0 x 1 0 )   ?   t r u e   :   f a l s e ; 
 
                 
 
                 i f   ( S h i f t D o w n )   { 
 
                         l a n g _ i d x   =   l a n g _ i d x   < =   0   ?   l a n g _ a r r . l e n g t h   -   1   :   l a n g _ i d x   -   1 ; 
 
                 }   e l s e   { 
 
                         l a n g _ i d x   =   l a n g _ i d x   > =   l a n g _ a r r . l e n g t h   -   1   ?   0   :   l a n g _ i d x   +   1 ; 
 
                 } 
 
                 
 
                 w i n d o w . S e t P r o p e r t y ( " l a n g " ,   l a n g _ i d x ) ; 
 
                 g e t _ t e x t ( ) ; 
 
                 t o o l t i p _ t e x t   =   g e t _ t e x t _ m e n u ( l a n g _ a r r [ l a n g _ i d x ] ) ; 
 
                 t o o l t i p   & &   i n f o _ t o o l t i p ( ) ; 
 
         } 
 
 
 
         i f   ( o n _ p i c ) { 
 
                 d a t a _ m a i n   =   d a t a _ m a i n   = =   1   ?   0   :   1 ; 
 
                 w i n d o w . S e t P r o p e r t y ( " d a t a _ m a i n :   b i o   o r   a l b u m ,   s i m i l a r " ,   d a t a _ m a i n ) ;   
 
                 g e t _ i m g ( m e t a _ a r t i s t ,   m e t a _ a l b u m ,   m e t a _ t i t l e ) ; 
 
                 
 
                 s w i t c h ( d a t a _ m a i n )   { 
 
                 c a s e   0 : 
 
                         t o o l t i p _ t e x t   =   " a r t i s t " ; 
 
                         b r e a k ; 
 
                 c a s e   1 : 
 
                         t o o l t i p _ t e x t   =   d a t a _ o t h e r [ d a t a _ o t h e r _ i d x ] [ 2 ] . r e p l a c e ( / _ / g , "   " ) ; 
 
                         b r e a k ; 
 
                 } 
 
                 t o o l t i p   & &   i n f o _ t o o l t i p ( ) ; 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   o n _ m o u s e _ m b t n _ d b l c l k   ( x , y ) { 
 
         i f   ( o n _ h e a d e r ) { 
 
                 ! t e x t _ h i d e n   & &   h i d e _ t e x t ( x , y ) ; 
 
                 t e x t _ h i d e n   & &   r e s t o r e _ t e x t ( ) ;   
 
                 t e x t _ h i d e n   =   ! t e x t _ h i d e n ; 
 
                 w i n d o w . S e t P r o p e r t y ( " t x t   h i d e n " ,   t e x t _ h i d e n ) ; 
 
                 
 
                 w i n d o w . S e t P r o p e r t y ( " t x t _ x " ,   t x t _ x ) ; 
 
                 w i n d o w . S e t P r o p e r t y ( " t x t _ y " ,   t x t _ y ) ; 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   o n _ m o u s e _ l e a v e ( )   { 
 
         w i n d o w . S e t C u r s o r ( I D C _ A R R O W ) ; 
 
         o n _ s b   =   f a l s e ; 
 
         w i n d o w . R e p a i n t ( ) ;   
 
 } 
 
 
 
 f u n c t i o n   h i d e _ t e x t ( x , y ) {     
 
         w i n d o w . S e t P r o p e r t y ( " t m p _ t x t _ x " ,   t x t _ x ) ; 
 
         w i n d o w . S e t P r o p e r t y ( " t m p _ t x t _ y " ,   t x t _ y ) ; 
 
 
 
         t x t _ x   =   w w   -   t _ m a r g i n   *   2   -   h 1 _ c h a r _ w i d t h   -   ( s c r o l l b a r   ?   s c r o l l b a r _ w   +   1 0   :   0 ) ; 
 
         t x t _ y   =   w h   -   ( h 1 _ t e x t _ r o w _ h e i g h t   +   t _ m a r g i n   *   2 ) ; 
 
         g e t _ t e x t _ a r r a y ( ) ; 
 
 } 
 
 
 
 f u n c t i o n   r e s t o r e _ t e x t ( ) {     
 
         t x t _ x   =   w i n d o w . G e t P r o p e r t y ( " t m p _ t x t _ x " ) ; 
 
         t x t _ y   =   w i n d o w . G e t P r o p e r t y ( " t m p _ t x t _ y " ) ; 
 
         g e t _ t e x t _ a r r a y ( ) ; 
 
 } 
 
 
 
 f u n c t i o n   o n _ s i z e ( ) { 
 
         w w   =   w i n d o w . W i d t h ;       
 
         w h   =   w i n d o w . H e i g h t ; 
 
       
 
         t x t _ x   =   w i n d o w . G e t P r o p e r t y ( " t x t _ x " ) ; 
 
         t x t _ y   =   w i n d o w . G e t P r o p e r t y ( " t x t _ y " ) ; 
 
 
 
         t x t _ x   =   t x t _ x   > =   w w   -   5 0   & &   t x t _ x   > =   0   ?   w w   -   5 0   :   t x t _ x ; 
 
         t x t _ y   =   t x t _ y   > =   w h   -   ( h 1 _ t e x t _ r o w _ h e i g h t   +   t _ m a r g i n )   & &   t x t _ y   > =   0   ?   w h   -   ( h 1 _ t e x t _ r o w _ h e i g h t   +   t _ m a r g i n )   :   t x t _ y ; 
 
 
 
         r e f r e s h _ t x t   =   t r u e ; 
 
         g e t _ t e x t _ a r r a y ( ) ; 
 
 } 
 
 
 
 f u n c t i o n   d e l _ f o l d e r s ( n ) { 
 
         v a r   d i r   =   f s o . G e t F o l d e r ( w o r k _ p a t h ) ; 
 
         v a r   e   =   n e w   E n u m e r a t o r (   d i r . S u b F o l d e r s   ) ; 
 
         t r y   { 
 
                 f o r ( ;   ! e . a t E n d ( ) ;   e . m o v e N e x t ( )   )   { 
 
                         v a r   n a m e   =   e . i t e m ( ) . N a m e ; 
 
                         i f   ( n a m e . i n d e x O f ( " _ d o w n l o a d " )   <   0 ) { 
 
                                 i f   ( n a m e . i n d e x O f ( n )   <   0 ) { 
 
                                         f s o . d e l e t e F o l d e r ( w o r k _ p a t h   +   n a m e ,   t r u e ) ; 	 
 
                                 } 	 
 
                         }       	 
 
                 } 	 
 
         }   c a t c h ( e )   { } ; 	 
 
 } 
 
 
 
 f u n c t i o n   d e l _ f o l d e r ( n ) { 
 
         i f ( ! n )   r e t u r n ; 
 
         t r y   { 
 
                 f s o . d e l e t e F o l d e r ( n ,   t r u e ) ; 	 
 
         }   c a t c h ( e )   { } ; 	 
 
 } 	 
 
 	 
 
 f u n c t i o n   c a l c _ i m g _ s i z e ( i m g ) { 	 
 
         i f ( ! i m g )   r e t u r n ; 	 
 
         v a r   s i z e   =   { x : 0 ,   y : 0 ,   w i d t h : 0 ,   h e i g h t : 0 ,   c x : 0 ,   c y : 0 ,   c w i d t h : 0 ,   c h e i g h t : 0 } ; 	 
 
 	 
 
         s w i t c h ( a l i g n _ m o d e )   { 	 
 
 	 c a s e   0 :   / /   a d j u s t 
 
                 v a r   s w   =   w w   /   i m g . W i d t h ; 	 
 
                 v a r   s h   =   w h   /   i m g . H e i g h t ; 	 
 
                 v a r   s   =   M a t h . m i n ( s w ,   s h ) ; 	 
 
                 	 	 
 
                 v a r   x   =   0 ; 	 	 
 
                 v a r   y   =   0 ; 	 	 
 
                 	 	 
 
                 i f   ( s w   >   s h )   x   =   ( w w   -   i m g . W i d t h   *   s )   /   2 ; 	 	 
 
                 e l s e   i f   ( s w   <   s h )   y   =   ( w h   -   i m g . h e i g h t   *   s )   /   2 ; 	 	 
 
 	 	 
 
                 v a r   w i d t h   =   i m g . W i d t h   *   s ; 	 	 
 
                 v a r   h e i g h t   =   i m g . H e i g h t   *   s ; 	 	 
 
                 v a r   c x   =   0 ; 	 	 
 
                 v a r   c y   =   0 ; 	 	 
 
                 v a r   c w i d t h   =   i m g . W i d t h ; 	 	 
 
                 v a r   c h e i g h t   =   i m g . H e i g h t ; 	 	 
 
 	 	 b r e a k ; 
 
                 	 	 
 
         c a s e   1 :   / /   a d j u s t   t o p   -   c e n t e r 	 	 
 
                 v a r   s w   =   w w   /   i m g . W i d t h ; 	 	 
 
                 v a r   s h   =   w h   /   i m g . H e i g h t ; 	 	 
 
                 v a r   s   =   M a t h . m i n ( s w ,   s h ) ; 	 	 
 
 	 	 
 
                 v a r   x   =   0 ; 	 	 
 
                 i f   ( s w   >   s h )   x   =   ( w w   -   i m g . W i d t h   *   s )   /   2 ; 	 	 
 
                 v a r   y   =   0 ; 	 	 
 
                 v a r   w i d t h   =   i m g . W i d t h   *   s ; 	 	 
 
                 v a r   h e i g h t   =   i m g . H e i g h t   *   s ; 	 	 
 
                 v a r   c x   =   0 ; 	 	 
 
                 v a r   c y   =   0 ; 	 	 
 
                 v a r   c w i d t h   =   i m g . W i d t h ; 	 	 
 
                 v a r   c h e i g h t   =   i m g . H e i g h t ; 	 	 
 
 	 	 b r e a k ; 
 
                 	 	 
 
         c a s e   2 :   / /   a d j u s t   t o p   -   l e f t 	 	 
 
                 v a r   s w   =   w w   /   i m g . W i d t h ; 	 	 
 
                 v a r   s h   =   w h   /   i m g . H e i g h t ; 	 	 
 
                 v a r   s   =   M a t h . m i n ( s w ,   s h ) ; 	 	 
 
                 	 	 
 
                 v a r   x   =   0 ; 	 	 
 
                 v a r   y   =   0 ; 	 	 
 
                 v a r   w i d t h   =   i m g . W i d t h   *   s ; 	 	 
 
                 v a r   h e i g h t   =   i m g . H e i g h t   *   s ; 	 	 
 
                 v a r   c x   =   0 ; 	 	 
 
                 v a r   c y   =   0 ; 	 	 
 
                 v a r   c w i d t h   =   i m g . W i d t h ; 	 	 
 
                 v a r   c h e i g h t   =   i m g . H e i g h t ; 	 	 
 
 	 	 b r e a k ; 
 
 	 	 
 
 	 c a s e   3 :   / /   c e n t r e 	 
 
 	 	 v a r   s r   =   i m g . W i d t h   /   i m g . H e i g h t ; 
 
 	 	 v a r   d r   =   w w   /   w h ; 	 
 
 	 	 i f   ( s r   <   d r )   { 	 
 
 	 	 	 v a r   r   =   i m g . W i d t h   /   w w ; 
 
 	 	 	 v a r   c h e i g h t   =   w h   *   r ; 
 
 	 	 	 v a r   c y   =   M a t h . r o u n d ( ( i m g . H e i g h t   -   c h e i g h t )   /   2 ) ; 
 
 	 	 	 v a r   c w i d t h   =   i m g . W i d t h ; 
 
 	 	 	 v a r   c x   =   0 ; 
 
 	 	 }   e l s e   { 	 
 
 	 	 	 v a r   r   =   i m g . H e i g h t   /   w h ; 
 
 	 	 	 v a r   c w i d t h   =   w w   *   r ; 
 
 	 	 	 v a r   c x   =   M a t h . r o u n d ( ( i m g . W i d t h   -   c w i d t h )   /   2 ) ; 
 
 	 	 	 v a r   c h e i g h t   =   i m g . H e i g h t ; 
 
 	 	 	 v a r   c y   =   0 ; 
 
 	 	 } 	 
 
                 v a r   x   =   0 ; 	 	 	 
 
                 v a r   y   =   0 ; 	 	 	 
 
                 v a r   w i d t h   =   w w ; 	 	 	 
 
                 v a r   h e i g h t   =   w h ; 	 	 	 
 
 	 	 b r e a k ; 	 
 
                 	 	 	 
 
 	 c a s e   4 :   / /   c e n t r e   -   t o p 	 	 
 
 	 	 v a r   s r   =   i m g . W i d t h   /   i m g . H e i g h t ; 	 
 
 	 	 v a r   d r   =   w w   /   w h ; 	 
 
 	 	 i f   ( s r   <   d r )   { 	 
 
 	 	 	 v a r   r   =   i m g . W i d t h   /   w w ; 
 
 	 	 	 v a r   c h e i g h t   =   w h   *   r ; 
 
 	 	 	 v a r   c y   =   0 ; 
 
 	 	 	 v a r   c w i d t h   =   i m g . W i d t h ; 
 
 	 	 	 v a r   c x   =   0 ; 
 
 	 	 }   e l s e   { 	 
 
 	 	 	 v a r   r   =   i m g . H e i g h t   /   w h ; 
 
 	 	 	 v a r   c w i d t h   =   w w   *   r ; 
 
 	 	 	 v a r   c x   =   M a t h . r o u n d ( ( i m g . W i d t h   -   c w i d t h )   /   2 ) ; 
 
 	 	 	 v a r   c h e i g h t   =   i m g . H e i g h t ; 
 
 	 	 	 v a r   c y   =   0 ; 
 
 	 	 } 	 
 
                 v a r   x   =   0 ; 	 	 	 
 
                 v a r   y   =   0 ; 	 	 	 
 
                 v a r   w i d t h   =   w w ; 	 	 	 
 
                 v a r   h e i g h t   =   w h ; 	 	 	 
 
 	 	 b r e a k ; 	 
 
                 	 	 	 
 
 	 c a s e   5 :   / /   s t r e t c h 	 	 
 
                 v a r   x   =   0 ; 	 	 	 
 
                 v a r   y   =   0 ; 	 	 	 
 
                 v a r   w i d t h   =   w w ; 	 	 	 
 
                 v a r   h e i g h t   =   w h ; 	 	 	 
 
                 v a r   c x   =   0 ; 	 	 	 
 
                 v a r   c y   =   0 ; 	 	 
 
                 v a r   c w i d t h   =   i m g . W i d t h ; 	 	 
 
                 v a r   c h e i g h t   =   i m g . H e i g h t ; 	 	 
 
 	 	 b r e a k ; 
 
         } 	 	 
 
         	 	 
 
         s i z e . x   =   M a t h . r o u n d ( x   +   p _ m a r g i n ) ; 	 	 
 
         s i z e . y   =   M a t h . r o u n d ( y   +   p _ m a r g i n ) ;   	 	 
 
         s i z e . w i d t h   =   M a t h . r o u n d ( w i d t h   -   p _ m a r g i n   *   2 ) ;   	 	 
 
         s i z e . h e i g h t   =   M a t h . r o u n d ( h e i g h t   -   p _ m a r g i n   *   2 ) ;   	 	 
 
         s i z e . c x   =   M a t h . r o u n d ( c x ) ;   	 	 
 
         s i z e . c y   =   M a t h . r o u n d ( c y ) ; 	 	 
 
         s i z e . c w i d t h   =   M a t h . r o u n d ( c w i d t h ) ; 	 	 
 
         s i z e . c h e i g h t   =   M a t h . r o u n d ( c h e i g h t ) ; 	 	 
 
         	 	 
 
         r e t u r n   s i z e ; 	 	 
 
 } 
 
 
 
 f u n c t i o n   c o p y _ f i l e s ( s e l e c t _ f i l e ) { 
 
         v a r   d e s t i n a t i o n _ p a t h ; 
 
         v a r   t m p _ d e s t i n a t i o n _ p a t h ; 
 
         v a r   t m p _ f i l e s   =   [ ] ; 
 
         v a r   t m p _ a r t i s t   =   m e t a _ a r t i s t ; 
 
         v a r   t m p _ f o l d e r ; 
 
 
 
         s w i t c h ( d a t a _ m a i n )   { 
 
         c a s e   0 : 
 
                 t m p _ f o l d e r   =   " a r t i s t " ; 
 
                 b r e a k ; 
 
         c a s e   1 : 
 
                 t m p _ f o l d e r   =   d a t a _ o t h e r [ d a t a _ o t h e r _ i d x ] [ 2 ] ; 
 
                 b r e a k ; 
 
         } 
 
 
 
         i f   ( c o m p l e t e _ p a t h . i n d e x O f ( ' h t t p : / / ' )   > =   0   | | c o m p l e t e _ p a t h . i n d e x O f ( ' y o u t u b e ' )   > =   0   | |   c o m p l e t e _ p a t h . i n d e x O f ( ' c d d a ' )   > =   0 )   { 
 
                 t m p _ d e s t i n a t i o n _ p a t h   =   f b . P r o f i l e P a t h   +   " t m p _ l a s t F M _ i m g \ \ " ; 
 
         }   e l s e   { 
 
                 t m p _ d e s t i n a t i o n _ p a t h   =   d i r e c t o r y _ p a t h   +   " \ \ "   +   t m p _ f o l d e r   +   " \ \ " ; 
 
         }       
 
         
 
         v a r   n l   =   " \ "   +   c h r ( 1 0 )   +   \ " " ; 
 
 
 
         i f   ( s e l e c t _ f i l e   = =   0 ) { 
 
                 t m p _ f i l e s . p u s h ( f i l e s [ s e l e c t e d ] ) ; 
 
                 v a r   i n p u t _ b o x _ t e x t   =   " C o p y     "   +   n l   +   n l   +   g e t _ f n e x t ( t m p _ f i l e s [ 0 ] )   +   n l   +   " f i l e   t o " ; 
 
         }   e l s e   { 
 
                 t m p _ f i l e s   =   f i l e s ; 
 
                 v a r   i n p u t _ b o x _ t e x t   =   " C o p y     "   +   n l   +   n l   +   t m p _ a r t i s t   +   "   *   "   +   t m p _ f o l d e r   +   " . j p g "   +   n l   +   " f i l e s   t o " ; 
 
         } 
 
 
 
         v a r   s t r i n g   =   i n p u t _ b o x ( i n p u t _ b o x _ t e x t ,   t m p _ d e s t i n a t i o n _ p a t h ,   " F o o b a r   2 0 0 0 " ) ; 
 
         i f   ( ! / \ S / . t e s t ( s t r i n g ) )   c o p y _ f i l e s ( ) ; 
 
         
 
         i f   ( s t r i n g ) { 
 
                 d e s t i n a t i o n _ p a t h   =   f o l d e r _ e x i s t s ( s t r i n g ) ; 
 
                 i f   ( f s o . F o l d e r E x i s t s ( d e s t i n a t i o n _ p a t h ) )   { 
 
                         c o p y _ f i l e s _ t o _ f o l d e r ( d e s t i n a t i o n _ p a t h ,   t m p _ f i l e s ,   t m p _ f o l d e r ) ; 
 
                 } 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   c o p y _ f i l e s _ t o _ f o l d e r ( p a t h ,   f i l e s ,   f o l d e r ) { 
 
         f o r   ( i   i n   f i l e s )   { 
 
                 t r y   { 
 
                         f s o . C o p y F i l e   ( f i l e s [ i ] ,   p a t h     ,   1 ) ; 
 
                 }   c a t c h ( e )   { } 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   i n p u t _ b o x ( p _ t e x t ,   d _ t e x t ,   w _ t i t l e ) { 
 
         v b e   =   n e w   A c t i v e X O b j e c t ( ' S c r i p t C o n t r o l ' ) ; 
 
         v b e . L a n g u a g e   =   ' V B S c r i p t ' ; 
 
         r e t u r n   v b e . e v a l (   " I n p u t B o x ( \ " "   +   p _ t e x t   +   " \ " , \ " "   +   w _ t i t l e   +   " \ " , \ " "   +   d _ t e x t   +   " \ " ) " ) ; 
 
 } 
 
 
 
 f u n c t i o n   c l e a n _ p a t h _ n a m e ( n )   { 
 
         i f   ( ! n )   r e t u r n ; 
 
         r e t u r n   n . r e p l a c e ( / [ \ / \ : \ * \ ? \ " \ < \ > \ | ] / g , ' ' ) ; 
 
 } 
 
 
 
 f u n c t i o n   f o l d e r _ e x i s t s ( n )   { 
 
         v a r   d r i v e r   =   f s o . G e t D r i v e N a m e ( n ) ; 
 
         i f   ( ! f s o . D r i v e E x i s t s ( d r i v e r ) )   { 
 
                 r e t u r n   " " ; 
 
         }   e l s e   { 
 
                 v a r   p   =   " " ; 
 
                 v a r   s p l i t _ s t r i n g   =   [ ] ; 
 
                 s p l i t _ s t r i n g   =   n . r e p l a c e ( / \ \ $ / g ,   " " ) . s p l i t ( " \ \ " ) ; 
 
 
 
                 f o r   ( v a r   i   =   1 ;   i   <   s p l i t _ s t r i n g . l e n g t h ;   i   + =   1 )   { 
 
                         p   =   p   +   c l e a n _ p a t h _ n a m e ( s p l i t _ s t r i n g [ i ] )   +   " \ \ " ; 
 
                         t r y   { 
 
                                 i f ( ! f s o . F o l d e r E x i s t s ( d r i v e r   +   " \ \ "   +   p ) )   f s o . C r e a t e F o l d e r ( d r i v e r   +   " \ \ "   +   p ) ; 
 
                         }   c a t c h ( e )   { } ; 
 
                 } 
 
                 r e t u r n   d r i v e r   +   " \ \ "   +   p ; 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   i m g _ f i l e _ i n f o ( ) { 
 
         v a r   i m g _ w ,   i m g _ h ,   i m g _ n a m e ,   i m g _ d i m ; 
 
         i f   ( f i l e s [ s e l e c t e d ] ) { 
 
                 i m g _ n a m e   =   " \ n \ n "   +   g e t _ f n e x t ( f i l e s [ s e l e c t e d ] ) ; 
 
                 i m g _ w   =   g d i . I m a g e ( f i l e s [ s e l e c t e d ] ) . w i d t h ; 
 
                 i m g _ h   =   g d i . I m a g e ( f i l e s [ s e l e c t e d ] ) . H e i g h t ; 
 
                 i m g _ d i m   =   " \ n "   +   i m g _ w   +   "   x   "   +   i m g _ h ; 
 
                 r e t u r n   i m g _ n a m e   +   i m g _ d i m ; 
 
         }   e l s e   { 
 
                 r e t u r n   " " ; 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   n a t u r a l S o r t ( s t r i n g A r r a y )   { 
 
         v a r   x o r   =   f u n c t i o n ( a ,   b )   { 
 
                 r e t u r n   a   ?   ! b   :   b ; 
 
         } 
 
         v a r   i s D i g i t   =   f u n c t i o n ( c h r )   { 
 
                 v a r   c h a r C o d e   =   f u n c t i o n ( c h )   { 
 
                         r e t u r n   c h . c h a r C o d e A t ( 0 ) ; 
 
                 } ; 
 
                 v a r   c o d e   =   c h a r C o d e ( c h r ) ; 
 
                 r e t u r n   ( c o d e   > =   c h a r C o d e ( ' 0 ' ) )   & &   ( c o d e   < =   c h a r C o d e ( ' 9 ' ) ) ; 
 
         } 
 
         v a r   s p l i t S t r i n g   =   f u n c t i o n ( s t r )   { 
 
                 v a r   f r o m   =   0 ;       
 
                 v a r   i n d e x   =   0 ; 
 
                 v a r   c o u n t   =   0 ;     
 
                 v a r   s p l i t t e r   =   { } ; 
 
 
 
                 s p l i t t e r . c o u n t   =   f u n c t i o n   ( )   { 
 
                         r e t u r n   c o u n t ; 
 
                 } 
 
                 s p l i t t e r . n e x t   =   f u n c t i o n ( )   { 
 
                         i f   ( i n d e x   = = =   s t r . l e n g t h )   { 
 
                                 r e t u r n   n u l l ; 
 
                         } 
 
                         w h i l e ( + + i n d e x )   { 
 
                                 v a r   c u r r e n t I s D i g i t   =   i s D i g i t ( s t r . c h a r A t ( i n d e x   -   1 ) ) ;     
 
                                 v a r   n e x t C h a r   =   s t r . c h a r A t ( i n d e x ) ; 
 
                                 v a r   c u r r e n t I s L a s t   =   ( i n d e x   = = =   s t r . l e n g t h ) ; 
 
                                 v a r   i s B o r d e r   =   c u r r e n t I s L a s t   | |   x o r ( c u r r e n t I s D i g i t ,   i s D i g i t ( n e x t C h a r ) ) ;                 
 
                                 i f   ( i s B o r d e r )   { 
 
                                 v a r   p a r t   =   s t r . s l i c e ( f r o m ,   i n d e x ) ; 
 
                                         f r o m   =   i n d e x ; 
 
                                         c o u n t + + ; 
 
                                         r e t u r n   { 
 
                                                 I s N u m b e r :   c u r r e n t I s D i g i t , 
 
                                                 V a l u e :   c u r r e n t I s D i g i t   ?   N u m b e r ( p a r t )   :   p a r t 
 
                                         } 
 
                                 } 
 
                         }   
 
                 }   
 
                 r e t u r n   s p l i t t e r ; 
 
         } 
 
         v a r   c o m p a r e S t r i n g s   =   f u n c t i o n ( s t r 1 ,   s t r 2 )   { 
 
                 v a r   c o m p a r e   =   f u n c t i o n ( a ,   b )   {     
 
                         r e t u r n   ( a   <   b )   ?   - 1   :   ( a   >   b )   ?   1   :   0 ; 
 
                 } 
 
                 v a r   s p l i t t e r 1   =   s p l i t S t r i n g ( s t r 1 ) ; 
 
                 v a r   s p l i t t e r 2   =   s p l i t S t r i n g ( s t r 2 ) ; 
 
                 w h i l e   ( t r u e )   { 
 
                         v a r   f i r s t   =   s p l i t t e r 1 . n e x t ( ) ; 
 
                         v a r   s e c o n d   =   s p l i t t e r 2 . n e x t ( ) ; 
 
                         i f   ( n u l l   ! = =   f i r s t   & &   n u l l   ! = =   s e c o n d )   { 
 
                                 i f   ( x o r ( f i r s t . I s N u m b e r ,   s e c o n d . I s N u m b e r ) )   { 
 
                                         r e t u r n   f i r s t . I s N u m b e r   ?   - 1   :   1 ;                 
 
                                 }   e l s e   {                                         
 
                                         v a r   c o m p   =   c o m p a r e ( f i r s t . V a l u e ,   s e c o n d . V a l u e ) ;         
 
                                         i f   ( c o m p   ! =   0 )   { 
 
                                                 r e t u r n   c o m p ; 
 
                                         } 
 
                                 } 	 	 	 	 	 	 
 
                         }   e l s e   { 	 	 	 	 	 	 
 
                                 r e t u r n   c o m p a r e ( s p l i t t e r 1 . c o u n t ( ) ,   s p l i t t e r 2 . c o u n t ( ) ) ; 	 	 	 	 	 	 
 
                         } 	 	 	 	 	 	 
 
                 } 	 	 	 	 	 	 
 
         } 	 	 	 	 	 	 
 
         v a r   a r r   =   s t r i n g A r r a y ; 	 	 	 	 	 	 
 
         r e t u r n   a r r . s o r t ( c o m p a r e S t r i n g s ) ;     	 	 	 	 	 	 
 
 } 
 
 
 
 f u n c t i o n   d e l e t e _ e m p t y _ f o l d e r s ( ) { 
 
         v a r   b u t t o n _ t y p e   =   0 x 3 ; 
 
         v a r   i c o n _ t y p e ; 
 
         v a r   t x t ; 
 
 
 
         v a r   d i r   =   f s o . G e t F o l d e r ( w o r k _ p a t h ) ; 
 
         v a r   i t e m s   =   c h e c k _ f o l d e r s ( d i r ,   0 ) ; 
 
         
 
         i f   ( i t e m s   = =   0 ) { 
 
                 i c o n _ t y p e   =   0 x 4 0 ; 
 
                 t x t   =   " N o t h i n g   f o u n d " ; 
 
         }   e l s e   { 
 
                 i c o n _ t y p e   =   0 x 2 0 ; 
 
                 t x t   =   " D e l e t e   e m p t y   "   +   ( i t e m s   >   1   ?   ( " f o l d e r s   ( "   +   i t e m s   +   " ) " )   :   " f o l d e r " ) ; 
 
         } 
 
         
 
         v a r   b t n   =   W s h S h e l l . P o p u p ( t x t   +   " \ n i n \ n "   +   d i r ,   0 ,   " F o o b a r   2 0 0 0 " ,   b u t t o n _ t y p e   +   i c o n _ t y p e ) ; 
 
         s w i t c h   ( b t n )   { 
 
         c a s e   6 : 
 
                 i f   ( i t e m s   >   0 ) { 
 
                         c h e c k _ f o l d e r s ( d i r ,   1 ) ; 
 
                 } 
 
                 b r e a k ; 
 
         c a s e   2 : 
 
         c a s e   7 : 
 
                 b r e a k ;   
 
         } 
 
 } 
 
 
 
 f u n c t i o n   c h e c k _ f o l d e r s ( d i r ,   t o _ d o ) { 
 
         v a r   e m p t y   =   0 
 
         v a r   e   =   n e w   E n u m e r a t o r (   d i r . S u b F o l d e r s   ) ; 
 
         f o r ( ;   ! e . a t E n d ( ) ;   e . m o v e N e x t ( )   )   { 
 
                 v a r   s u b _ f o l d e r   =   o b j S h e l l A p p . N a m e S p a c e (   e . i t e m ( )   +   " \ \ "   ) ; 
 
                 v a r   i t e m s   =   s u b _ f o l d e r . I t e m s ( ) ; 
 
                 v a r   i t e m s _ c o u n t   =   i t e m s . C o u n t ; 
 
 
 
                 i f   ( i t e m s _ c o u n t   = =   0 ) { 
 
                         e m p t y + + ; 
 
                         i f   ( t o _ d o   = =   1 ) { 
 
                                 t r y   { 
 
                                         f s o . d e l e t e F o l d e r ( e . i t e m ( ) ,   t r u e ) ; 
 
                                 }   c a t c h ( e )   { } 
 
                         } 
 
                 } 
 
         } 
 
         i f   ( t o _ d o   = =   0 )   r e t u r n   e m p t y ; 
 
 } 
 
 	 	 	 	 	 
 
 f u n c t i o n   g e t _ l a s t F M _ m e t a _ a r t i s t _ i m g ( p a t h ,   t _ a r t i s t ) { 	 
 
         v a r   x m l h t t p 1   =   n e w   A c t i v e X O b j e c t ( " M i c r o s o f t . X M L H T T P " ) ;       	 	 	 	 	 	 
 
         v a r   u r l 1   =   ( " h t t p s : / / w w w . l a s t . f m / "   +   l a n g _ q u e r y ( l a n g _ i d x )   +   " m u s i c / "   +   e n c o d e U R I C o m p o n e n t ( t _ a r t i s t )   +   " / + "   +   " i m a g e s "   +   " ? p a g e = "   +   1 ) ;     	 	 	 	 	 	 
 
         x m l h t t p 1 . o p e n ( " G E T " ,   u r l 1 ,   t r u e   ) ;     	 	 	 	 	 	 
 
         x m l h t t p 1 . s e t R e q u e s t H e a d e r ( " I f - M o d i f i e d - S i n c e " ,   " S a t ,   1   J a n   2 0 0 0   0 0 : 0 0 : 0 0   G M T " ) ; 	 	 	 	 	 	 
 
         x m l h t t p 1 . s e n d ( n u l l ) ;           	 	 	 	 	 	 
 
         x m l h t t p 1 . o n r e a d y s t a t e c h a n g e   =   f u n c t i o n   ( )   {   
 
                 i f   ( x m l h t t p 1 . r e a d y S t a t e   = =   4 )   {   
 
                         i f   ( x m l h t t p 1 . s t a t u s   = =   2 0 0 )   {     
 
                                 d o c . o p e n ( ) ;           
 
                                 v a r   d i v   =   d o c . c r e a t e E l e m e n t ( " d i v " ) ; 
 
                                 d i v . i n n e r H T M L   =   x m l h t t p 1 . r e s p o n s e t e x t ; 
 
                                 v a r   i m g   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " i m g " ) ; 
 
                                 v a r   i m g _ u r l s   =   [ ] ; 
 
                                 
 
                                 v a r   d   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " d i v " ) ; 	   
 
                                 v a r   m s g   =   " " ; 
 
 
 
                                 f o r   ( i   =   0 ;   i   <   d . l e n g t h ;   i + + )   {     	 	 	 	 	 	 	 
 
                                         i f   ( d [ i ] . c l a s s N a m e   = =   " n o - d a t a - m e s s a g e " ) {       / /   " W e   d o n ' t   h a v e   a n y   p h o t o s   f o r   t h i s   a r t i s t   y e t . "     	 	 	 	 	 	 	 
 
                                               m s g   =   d [ i ] . i n n e r T e x t ; 
 
                                         } 	 	 	 	 	 	 	 
 
                                 } 
 
 
 
                                 n o _ i m g _ m s g   =   m s g   ?   m s g   +   " \ n \ n "   :   " " ; 
 
                                 
 
                                 f o r   ( i   =   0 ;   i   <   i m g . l e n g t h ;   i + + )   {         
 
                                         i f   ( i m g [ i ] . c l a s s N a m e   = =   " i m a g e - l i s t - i m a g e " ) {               
 
                                                 i f   ( i m g [ i ] . s r c . i n d e x O f ( " h t t p s : / / i m g 2 - a k . l s t . f m / i / u / a v a t a r 1 7 0 s " )   = =   0   | |   i m g [ i ] . s r c . i n d e x O f ( " h t t p s : / / l a s t f m - i m g 2 . a k a m a i z e d . n e t / i / u / a v a t a r 1 7 0 s " )   = =   0 )   { 
 
                                                         i m g _ u r l s . p u s h ( i m g [ i ] . s r c . r e p l a c e ( " a v a t a r 1 7 0 s " ,   q u a l i t y [ d o w n l o a d _ q u a l i t y ] [ 1 ] ) ) ; 
 
                                                 }           
 
                                         }   
 
                                 } 
 
                                 	 	 	 	 	 	 
 
                                 f o r   ( i   =   0 ;   i   <   M a t h . m i n ( i m g _ u r l s . l e n g t h ,   l i m i t ) ;   i + + )   {     
 
                                         v a r   i m g _ f i l e   =   " \ " "   +   p a t h   +   " \ \ "   +   t _ a r t i s t   +   " _ "     +   i   +   " _ "   +     " a r t i s t . j p g "   +   " \ " " ;   
 
                                         W s h S h e l l . R u n ( v b s   +   "   "   +   i m g _ u r l s [ i ]   +   "   "   +   i m g _ f i l e ,   0 ,   f a l s e ) ; 	 	 	 	 	 	 
 
                                 }     	 	 	 	 	 	 
 
                                 d o c . c l o s e ( ) ; 	 	 	 	 	 	 
 
                                 i f   ( i m g _ u r l s . l e n g t h   >   0   & &   ! g _ i m g )   g e t _ f i l e s _ i f _ l o a d e d ( p a t h ,   t _ a r t i s t ) ; 	 	 	 	 	 	 
 
                                 g e t _ t e x t ( ) ; 
 
                         }   e l s e   { g e t _ t e x t ( ) ; } 
 
                 }   	 	 	 	 	 	 
 
         }           	 	 	 	 	 	 
 
 } 	 	 	 	 	 	 
 
 	 	 	 	 	 	 
 
 f u n c t i o n   g e t _ l a s t F M _ a l b u m _ i m g ( p a t h ,   t _ a r t i s t ) { 	 	 	 	 	 	 
 
         v a r   x m l h t t p 2   =   n e w   A c t i v e X O b j e c t ( " M i c r o s o f t . X M L H T T P " ) ;       	 	 	 	 	 	 
 
         v a r   u r l 2   =   ( " h t t p s : / / w w w . l a s t . f m / "   +   l a n g _ q u e r y ( l a n g _ i d x )   +   " m u s i c / "   +   e n c o d e U R I C o m p o n e n t ( t _ a r t i s t )   +   " / + "   +   d a t a _ o t h e r [ d a t a _ o t h e r _ i d x ] [ 1 ] ) ;     	 	 	 	 	 	 
 
         x m l h t t p 2 . o p e n ( " G E T " ,   u r l 2 ,   t r u e   ) ;     
 
         x m l h t t p 2 . s e t R e q u e s t H e a d e r ( " I f - M o d i f i e d - S i n c e " ,   " S a t ,   1   J a n   2 0 0 0   0 0 : 0 0 : 0 0   G M T " ) ; 
 
         x m l h t t p 2 . s e n d ( n u l l ) ;           
 
         x m l h t t p 2 . o n r e a d y s t a t e c h a n g e   =   f u n c t i o n   ( )   {   
 
                 i f   ( x m l h t t p 2 . r e a d y S t a t e   = =   4 )   {   
 
                         i f   ( x m l h t t p 2 . s t a t u s   = =   2 0 0 )   {     
 
                                 d o c . o p e n ( ) ;           
 
                                 v a r   d i v   =   d o c . c r e a t e E l e m e n t ( " d i v " ) ; 
 
                                 d i v . i n n e r H T M L   =   x m l h t t p 2 . r e s p o n s e t e x t ; 
 
                                 v a r   i m g   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " i m g " ) ; 
 
                                 v a r   p   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " p " ) ; 
 
                                 
 
                                 v a r   m s g   =   " " ; 
 
 
 
                                 f o r   ( i   =   0 ;   i   <   p . l e n g t h ;   i + + )   {     	 	 	 	 	 	 	 
 
                                         i f   ( p [ i ] . c l a s s N a m e   = =   " w i k i - c t a   l i n k - b l o c k   j s - l i n k - b l o c k " ) {     	 / /   D o   y o u   k n o w   a n y   b a c k g r o u n d   i n f o   a b o u t   t h i s   a l b u m ? 	 	 	 	 	 	 
 
                                                 m s g   =   p [ i ] . i n n e r H T M L ; 
 
                                         } 	 	 	 	 	 	 	 
 
                                 } 
 
                                 
 
                                 n o _ i m g _ m s g   =   m s g ; 
 
                                 
 
                                 v a r   u r l s   =   [ ] ; 
 
                                 v a r   i m g _ u r l s   =   [ ] ; 
 
                                 v a r   m e t a d a t a _ 1   =   [ ] ; 
 
                                 v a r   m e t a d a t a _ 2   =   [ ] ; 
 
 
 
                                 f o r   ( i   =   0 ;   i   <   p . l e n g t h ;   i + + )   {       
 
                                         i f   ( p [ i ] . c l a s s N a m e   = =   " a l b u m - g r i d - i t e m - a u x - t e x t "   ) {   / /   a l b u m :   l i s t e n e r s ,   r e l e a s e   d a t e   
 
                                                 m e t a d a t a _ 2 . p u s h ( p [ i ] . i n n e r H T M L . r e p l a c e ( / \ , | ( & n b s p ; ) / g ,   '   ' ) ) ; 
 
                                         }                                       
 
                                 }     
 
 
 
                                 f o r   ( i   =   0 ;   i   <   i m g . l e n g t h ;   i + + )   {                     / /   a l l   i m g s     
 
                                         i f   ( ( i m g [ i ] . s r c . i n d e x O f ( " h t t p s : / / i m g 2 - a k . l s t . f m / i / u / 3 0 0 " )   = =   0   | |   i m g [ i ] . s r c . i n d e x O f ( " h t t p s : / / l a s t f m - i m g 2 . a k a m a i z e d . n e t / i / u / 3 0 0 " )   = =   0 ) )   {       
 
                                                 u r l s . p u s h ( i m g [ i ] . s r c ) ; 
 
                                                 m e t a d a t a _ 1 . p u s h ( i m g [ i ] . a l t ) ;                 / /   a l b u m :   n a m e     
 
                                         } 
 
                                 } 
 
                                 
 
                                 v a r   n a m e 1   =   [ ] ,   n a m e 2   =   [ ] ,   n a m e 3   =   [ ] ; 	 
 
 	 	 	 	 	 	 
 
                                 f o r   ( i   =   0 ;   i   <   u r l s . l e n g t h ;   i + + )   {   
 
                                         i f   ( u r l s [ i ] . i n d e x O f ( " c 6 f 5 9 c 1 e 5 e 7 2 4 0 a 4 c 0 d 4 2 7 a b d 7 1 f 3 d b b " )   <   0 )   {     / /   i f   i m g   i s   n o t   c 6 f 5 9 c 1 e 5 e 7 2 4 0 a 4 c 0 d 4 2 7 a b d 7 1 f 3 d b b 	 
 
                                                 i m g _ u r l s . p u s h ( u r l s [ i ] . r e p l a c e ( " 3 0 0 x 3 0 0 " ,   q u a l i t y [ d o w n l o a d _ q u a l i t y ] [ 2 ] ) ) ; 	 
 
                                                 
 
                                                 n a m e 1 . p u s h ( m e t a d a t a _ 1 [ i ] ) ;                     / /   a l b u m :   n a m e 	 	 	 	 	 	 
 
                                                 n a m e 2 . p u s h ( m e t a d a t a _ 2 [ i   *   2 ] ) ;             / /   a l b u m :   l i s t e n e r s 	 	 	 	 	 	 
 
                                                 n a m e 3 . p u s h ( m e t a d a t a _ 2 [ i   *   2   +   1 ] ) ;     / /   a l b u m :   r e l e a s e   d a t e 	 
 
                                         } 	 	 	 	 	 	 
 
                                 } 
 
 
 
                                 f o r   ( i   =   0 ;   i   <   M a t h . m i n ( i m g _ u r l s . l e n g t h ,   l i m i t ) ;   i + + )   {     
 
                                         u t i l s . W r i t e I N I (   p a t h   +   " \ \ "   +   t _ a r t i s t   +   " _ a l b u m _ i n f o . i n i " ,   d a t a _ o t h e r [ d a t a _ o t h e r _ i d x ] [ 2 ]   +   "   :   n a m e " ,   i ,   n a m e 1 [ i ] ) ; 	 
 
                                         u t i l s . W r i t e I N I (   p a t h   +   " \ \ "   +   t _ a r t i s t   +   " _ a l b u m _ i n f o . i n i " ,   d a t a _ o t h e r [ d a t a _ o t h e r _ i d x ] [ 2 ]   +   "   :   i n f o   :   "   +   l a n g _ a r r [ l a n g _ i d x ] ,   i ,   n a m e 2 [ i ]   +   " * "   +   n a m e 3 [ i ] ) ; 
 
 
 
                                         v a r   i m g _ f i l e   =   " \ " "   +   p a t h   +   " \ \ "   +   t _ a r t i s t   +   " _ "     +   c l e a n ( n a m e 1 [ i ] )   +   " . j p g "   +   " \ " " ;                                               	 	 	 	 	 
 
                                         i f   ( ! f s o . F i l e E x i s t s ( i m g _ f i l e ) ) { 	 
 
                                                 W s h S h e l l . R u n ( v b s   +   "   "   +   i m g _ u r l s [ i ]   +   "   "   +   i m g _ f i l e ,   0 ,   f a l s e ) ; 
 
                                         } 
 
                                 }         	 	 	 	 	 
 
                                 d o c . c l o s e ( ) ; 	 	 	 	 	 
 
                                 i f   ( i m g _ u r l s . l e n g t h   >   0   & &   ! g _ i m g )   { 
 
                                         g e t _ f i l e s _ i f _ l o a d e d ( p a t h ,   t _ a r t i s t ) 
 
                                 }   e l s e   { 
 
                                         g e t _ t e x t ( ) ; 
 
                                 } 
 
                         }   e l s e   { g e t _ t e x t ( ) ; } 
 
                 }   	 	 	 	 	 
 
         }       
 
 } 	 	 	 	 	 
 
 	 	 	 	 	 
 
 f u n c t i o n   g e t _ l a s t F M _ b i o _ t e x t ( f i l e ,   a ) { 	 	 	 	 	 
 
         x m l h t t p 3   =   n e w   A c t i v e X O b j e c t ( " M i c r o s o f t . X M L H T T P " ) ; 	 	 	 	 	 
 
         u r l 3   =   ( " h t t p s : / / w w w . l a s t . f m / "   +   l a n g _ q u e r y ( l a n g _ i d x )   +   " m u s i c / "   +   e n c o d e U R I C o m p o n e n t ( a )   +   " / + w i k i " ) ; 	 
 
         x m l h t t p 3 . o p e n ( " G E T " ,   u r l 3 ,   t r u e ) ; 	 	 	 	 	 
 
         x m l h t t p 3 . s e t R e q u e s t H e a d e r ( " I f - M o d i f i e d - S i n c e " ,   " S a t ,   1   J a n   2 0 0 0   0 0 : 0 0 : 0 0   G M T " ) ; 	 	 	 	 	 
 
         x m l h t t p 3 . s e n d ( n u l l ) ; 	 	 	 	 	 	 	 
 
         x m l h t t p 3 . o n r e a d y s t a t e c h a n g e   =   f u n c t i o n   ( )   { 	 	 	 	 	 	 	 
 
                 i f   ( x m l h t t p 3 . r e a d y S t a t e   = =   4 )   { 	 	 	 	 	 	 	 
 
                         i f   ( x m l h t t p 3 . s t a t u s   = =   2 0 0 )   { 	 	 	 	 	 	 	 
 
                                 d o c . o p e n ( ) ; 	 	 	 	 	 	 	 
 
                                 v a r   d i v   =   d o c . c r e a t e E l e m e n t ( " d i v " ) ; 	 	 	 	 	 	 	 
 
                                 d i v . i n n e r H T M L   =   x m l h t t p 3 . r e s p o n s e t e x t ; 	 	 	 	 	 	 	 
 
                                 v a r   d i v   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " d i v " ) ; 	 	 	 	 	 	 	 
 
                                 v a r   t   =   " " ; 	 	 	 	 	 	 	 
 
                                 v a r   s a v e _ t e x t   =   f a l s e ; 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 
 
                                 f o r   ( i   =   0 ;   i   <   d i v . l e n g t h ;   i + + )   { 	 	 	 	 	 	 	 
 
                                         i f   ( d i v [ i ] . c l a s s N a m e   = =   " w i k i " )   { 	 	 	 	 	 	 	 
 
                                                 t   =   d i v [ i ] . i n n e r H T M L ; 	 
 
                                                 s a v e _ t e x t   =   t . i n d e x O f ( ' w i k i - c o n t e n t ' )   >   0   ?   t r u e   :   f a l s e ; 	 	 	 	 	 	 	 
 
                                                 t   =   s t r i p _ t a g s ( t ) . r e p l a c e ( / ^ \ s + | \ s + $ / g ,   " " ) ; 	 	 	 	 	 	 	 
 
                                                 b r e a k ; 	 	 	 	 	 	 	 
 
                                         }   	 	 	 	 	 	 	 
 
                                 }   	 	 	 	 	 	 	 
 
                                 d o c . c l o s e ( ) ; 	 	 	 	 	 	 	 
 
                         }   
 
                         i f   ( t )   { 
 
                                 t e x t   =   t ;   
 
                                 s a v e _ t e x t   & &   s a v e _ t x t _ f i l e ( t ,   f i l e ) ; 
 
                         }   e l s e   { 
 
                                 t e x t   =   g e t _ t e x t _ n f ( l a n g _ a r r [ l a n g _ i d x ] ) ; 
 
                         } 
 
                         g e t _ t e x t _ a r r a y ( ) ; 
 
                 } 
 
         } 	 	 	 	 	 	 	 
 
 } 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
 f u n c t i o n   g e t _ l a s t F M _ a l b u m _ t e x t ( f i l e ,   t _ a r t i s t ,   t _ a l b u m ) { 	 
 
         x m l h t t p 4   =   n e w   A c t i v e X O b j e c t ( " M i c r o s o f t . X M L H T T P " ) ; 	 	 	 	 	 	 	 
 
         u r l 4   =   ( " h t t p s : / / w w w . l a s t . f m / "   +   l a n g _ q u e r y ( l a n g _ i d x )   +   " m u s i c / "   +   e n c o d e U R I C o m p o n e n t ( t _ a r t i s t )   +   " / "   +   e n c o d e U R I C o m p o n e n t ( t _ a l b u m ) . r e p l a c e ( " % 2 B " ,   " % 2 5 2 B " )   +   " / + w i k i " ) ; 
 
         x m l h t t p 4 . o p e n ( " G E T " ,   u r l 4 ,   t r u e ) ; 	 	 	 	 	 	 	 
 
         x m l h t t p 4 . s e t R e q u e s t H e a d e r ( " I f - M o d i f i e d - S i n c e " ,   " S a t ,   1   J a n   2 0 0 0   0 0 : 0 0 : 0 0   G M T " ) ; 	 	 	 	 	 	 	 
 
         x m l h t t p 4 . s e n d ( n u l l ) ; 	 	 	 	 	 	 	 
 
         x m l h t t p 4 . o n r e a d y s t a t e c h a n g e   =   f u n c t i o n   ( )   { 	 	 	 	 	 	 	 
 
                 i f   ( x m l h t t p 4 . r e a d y S t a t e   = =   4 )   { 	 	 	 	 	 	 	 
 
                         i f   ( x m l h t t p 4 . s t a t u s   = =   2 0 0 )   { 	 	 	 	 	 	 	 
 
                                 d o c . o p e n ( ) ; 	 	 	 	 	 	 	 
 
                                 v a r   d i v   =   d o c . c r e a t e E l e m e n t ( " d i v " ) ; 	 	 	 	 	 	 	 
 
                                 d i v . i n n e r H T M L   =   x m l h t t p 4 . r e s p o n s e t e x t ; 	 	 	 	 	 	 	 
 
                                 v a r   d i v   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " d i v " ) ; 	 	 	 	 	 	 
 
                                 v a r   t   =   " " ; 	 	 	 	 	 	 
 
                                 v a r   s a v e _ t e x t   =   f a l s e ; 	 	 	 	 	 	 
 
                                 	 	 	 	 	 	 
 
                                 f o r   ( i   =   0 ;   i   <   d i v . l e n g t h ;   i + + )   { 	 	 	 	 	 	 
 
                                         i f   ( d i v [ i ] . c l a s s N a m e   = =   " w i k i " )   { 	 	 	 	 	 	 
 
                                                 t   =   d i v [ i ] . i n n e r H T M L ; 	 
 
                                                 s a v e _ t e x t   =   t . i n d e x O f ( ' w i k i - c o n t e n t ' )   >   0   ?   t r u e   :   f a l s e ; 	 	 	 	 	 	 
 
                                                 t   =   s t r i p _ t a g s ( t ) . r e p l a c e ( / ^ \ s + | \ s + $ / g ,   " " ) ; 	 	 	 	 	 	 
 
                                                 b r e a k ; 	 	 	 	 	 	 
 
                                         }   	 	 	 	 	 	 
 
                                 }   
 
                         } 
 
                         i f   ( t )   { 
 
                                 t e x t   =   t ;   
 
                                 s a v e _ t e x t   & &   s a v e _ t x t _ f i l e ( t ,   f i l e ) ; 
 
                         }   e l s e   { 
 
                                 t e x t   =   g e t _ t e x t _ n f ( l a n g _ a r r [ l a n g _ i d x ] ) ; 
 
                         } 
 
                         g e t _ t e x t _ a r r a y ( ) ; 	 
 
                 } 
 
         } 	 	 	 	 	 	 
 
 } 	 	 	 	 	 	 
 
 	 	 	 	 	 	 
 
 f u n c t i o n   g e t _ l a s t F M _ s i m i l a r _ i m g ( p a t h ,   t _ a r t i s t ) { 	 
 
         v a r   x m l h t t p 5   =   n e w   A c t i v e X O b j e c t ( " M i c r o s o f t . X M L H T T P " ) ;       	 	 	 	 	 	 
 
         v a r   u r l 5   =   ( " h t t p s : / / w w w . l a s t . f m / "   +   l a n g _ q u e r y ( l a n g _ i d x )   +   " m u s i c / "   +   e n c o d e U R I C o m p o n e n t ( t _ a r t i s t )   +   " / + s i m i l a r " ) ;     	 	 	 	 	 
 
         x m l h t t p 5 . o p e n ( " G E T " ,   u r l 5 ,   t r u e   ) ;     
 
         x m l h t t p 5 . s e t R e q u e s t H e a d e r ( " I f - M o d i f i e d - S i n c e " ,   " S a t ,   1   J a n   2 0 0 0   0 0 : 0 0 : 0 0   G M T " ) ; 	 	 	 	 	 
 
         x m l h t t p 5 . s e n d ( n u l l ) ;           	 	 	 	 	 
 
         x m l h t t p 5 . o n r e a d y s t a t e c h a n g e   =   f u n c t i o n   ( )   {   	 	 	 	 	 
 
                 i f   ( x m l h t t p 5 . r e a d y S t a t e   = =   4 )   {   	 	 	 	 	 
 
                         i f   ( x m l h t t p 5 . s t a t u s   = =   2 0 0 )   {     	 	 	 	 	 
 
                                 d o c . o p e n ( ) ;           	 	 	 	 	 
 
                                 v a r   d i v   =   d o c . c r e a t e E l e m e n t ( " d i v " ) ; 	 	 	 	 	 
 
                                 d i v . i n n e r H T M L   =   x m l h t t p 5 . r e s p o n s e t e x t ; 	 	 	 	 	 
 
                                 v a r   i m g   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " i m g " ) ; 	 	 	 	 	 
 
                                 v a r   a   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " a " ) ; 	 
 
                                 v a r   p   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " p " ) ; 	                                 
 
 
 
                                 v a r   m s g   =   " " ; 
 
 
 
                                 f o r   ( i   =   0 ;   i   <   p . l e n g t h ;   i + + )   {     	 	 	 	 	 	 	 
 
                                         i f   ( p [ i ] . c l a s s N a m e   = =   " n o - d a t a - m e s s a g e " ) {     	 	 	 	 	 	 	 
 
                                               m s g   =   p [ i ] . i n n e r H T M L ; 
 
                                         } 	 	 	 	 	 	 	 
 
                                 } 
 
                                 
 
                                 n o _ i m g _ m s g   =   m s g   ?   m s g   +   " \ n \ n "   :   " " ; 
 
 
 
                                 v a r   i m g _ u r l s   =   [ ] ; 	 	 	 	 	 
 
                                 v a r   m e t a d a t a   =   [ ] ; 	 	 	 	 	 
 
                                 	 	 	 	 	 
 
                                 f o r   ( i   =   0 ;   i   <   a . l e n g t h ;   i + + )   {     	 	 	 	 	 	 	 
 
                                         i f   ( a [ i ] . c l a s s N a m e   = =   " l i n k - b l o c k - t a r g e t " ) {         / /   s i m i l a r   a r t i s t   n a m e s   	 	 	 	 	 	 	 
 
                                                 m e t a d a t a . p u s h ( a [ i ] . i n n e r H T M L . r e p l a c e ( / ( & a m p ; ) / g , ' & ' ) ) ; 	 
 
                                         } 	 	 	 	 	 	 	 
 
                                 }   	 	 	 	 	 	 	 
 
 	 	 	 	 	 
 
                                 f o r   ( i   =   0 ;   i   <   i m g . l e n g t h ;   i + + )   {   	 	 	 	 	 	 	 
 
                                         i f   ( i m g [ i ] . s r c . i n d e x O f ( " h t t p s : / / l a s t f m - i m g 2 . a k a m a i z e d . n e t / i / u / 2 7 0 x 2 0 5 " )   = =   0 ) { 	 
 
                                                 i m g _ u r l s . p u s h ( i m g [ i ] . s r c . r e p l a c e ( " 2 7 0 x 2 0 5 " ,   q u a l i t y [ d o w n l o a d _ q u a l i t y ] [ 1 ] ) ) ; 
 
                                         } 	 	 	 	 	 	 	 
 
                                 } 	 	 	 	 	 	 	 
 
 	 	 	 	 	 	 	 
 
                                 f o r   ( i   =   0 ;   i   <   M a t h . m i n ( i m g _ u r l s . l e n g t h ,   l i m i t ) ;   i + + )   {   	 	 	 	 	 	 	 
 
                                         u t i l s . W r i t e I N I (   p a t h   +   " \ \ "   +   t _ a r t i s t   +   " _ a l b u m _ i n f o . i n i " ,   d a t a _ o t h e r [ d a t a _ o t h e r _ i d x ] [ 2 ]   +   "   :   n a m e " ,   i ,   m e t a d a t a [ i ] ) ;   	 	 	 	 	 	 	 
 
                                         v a r   i m g _ f i l e   =   " \ " "   +   p a t h   +   " \ \ "   +   t _ a r t i s t   +   " _ "     +   i   +   " _ "   +   d a t a _ o t h e r [ d a t a _ o t h e r _ i d x ] [ 2 ]   +   " . j p g "   +   " \ " " ;     	 	 	 	 	 
 
                                         W s h S h e l l . R u n ( v b s   +   "   "   +   i m g _ u r l s [ i ]   +   "   "   +   i m g _ f i l e ,   0 ,   f a l s e ) ; 	 	 	 	 	 
 
                                 }         	 	 	 	 	 
 
                                 d o c . c l o s e ( ) ; 	 	 	 	 	 
 
                                 i f   ( i m g _ u r l s . l e n g t h   >   0 )   { g e t _ f i l e s _ i f _ l o a d e d ( p a t h ,   t _ a r t i s t ) ; 
 
                                 }   e l s e   { 
 
                                         g e t _ t e x t ( ) ; 
 
                                 } 
 
                         }   e l s e   { g e t _ t e x t ( ) ; } 
 
                 }   	 	 	 	 	 
 
         }           	 	 	 	 	 
 
 } 
 
 
 
 f u n c t i o n   g e t _ l a s t F M _ m e t a _ a l b u m _ i m g ( p a t h ,   t _ a r t i s t ,   t _ a l b u m ) { 	 
 
         v a r   x m l h t t p 6     =   n e w   A c t i v e X O b j e c t ( " M i c r o s o f t . X M L H T T P " ) ;       
 
         v a r   u r l 6   =   ( " h t t p s : / / w w w . l a s t . f m / "   +   l a n g _ q u e r y ( l a n g _ i d x )   +   " m u s i c / "   +   e n c o d e U R I C o m p o n e n t ( t _ a r t i s t )   +   " / "   +   e n c o d e U R I C o m p o n e n t ( t _ a l b u m ) ) ;     
 
         x m l h t t p 6 . o p e n ( " G E T " ,   u r l 6 ,   t r u e   ) ;   
 
         x m l h t t p 6 . s e t R e q u e s t H e a d e r ( " I f - M o d i f i e d - S i n c e " ,   " S a t ,   1   J a n   2 0 0 0   0 0 : 0 0 : 0 0   G M T " ) ; 
 
         x m l h t t p 6 . s e n d ( n u l l ) ;           
 
         x m l h t t p 6 . o n r e a d y s t a t e c h a n g e   =   f u n c t i o n   ( )   {   
 
                 i f   ( x m l h t t p 6 . r e a d y S t a t e   = =   4 )   {   
 
                         i f   ( x m l h t t p 6 . s t a t u s   = =   2 0 0 )   {   
 
                                 d o c . o p e n ( ) ;           
 
                                 v a r   d i v   =   d o c . c r e a t e E l e m e n t ( " d i v " ) ; 
 
                                 d i v . i n n e r H T M L   =   x m l h t t p 6 . r e s p o n s e t e x t ; 
 
                                 v a r   i m g   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " i m g " ) ; 
 
                                 v a r   a b b r   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " a b b r " ) ; 
 
                                 v a r   h 4   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " h 4 " ) ; 
 
                                 v a r   p   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " p " ) ;                                                                 
 
                                 
 
                                 v a r   m e t a d a t a _ 1   =   [ ] ,     m e t a d a t a _ 2   =   [ ] ,   m e t a d a t a   =   [ ] ; 
 
                               
 
                                 f o r   ( i   =   0 ;   i   <   a b b r . l e n g t h ;   i + + )   {   
 
                                         i f   ( a b b r [ i ] . c l a s s N a m e   = =   " i n t a b b r " ) { 
 
                                                 m e t a d a t a _ 1 . p u s h ( a b b r [ i ] . t i t l e . r e p l a c e ( / [ ^ 0 - 9 ] / g ,   "   " ) ) ; 
 
                                         } 
 
                                 } 
 
 
 
                                 f o r   ( i   =   0 ;   i   <   h 4 . l e n g t h ;   i + + )   {   
 
                                         i f   ( h 4 [ i ] . c l a s s N a m e   = =   " h e a d e r - m e t a d a t a - t i t l e " ) { 
 
                                                 m e t a d a t a . p u s h ( "     "   +   m e t a d a t a _ 1 [ i ]   +   "   "   +   h 4 [ i ] . i n n e r T e x t . t o L o w e r C a s e ( ) ) ; 
 
                                         } 
 
                                 } 
 
 
 
                                 f o r   ( i   =   0 ;   i   <   p . l e n g t h ;   i + + )   {   
 
                                         i f   ( p [ i ] . c l a s s N a m e   = =   " m e t a d a t a - d i s p l a y " ) { 
 
                                                 m e t a d a t a _ 2 . p u s h ( p [ i ] . i n n e r T e x t ) ; 
 
                                         } 
 
                                 } 
 
 
 
                                 i f   ( m e t a d a t a _ 2 . l e n g t h   >   0 ) { 
 
                                         m e t a d a t a . p u s h ( m e t a d a t a _ 2 . j o i n ( " ,   " ) ) ; 
 
                                 } 
 
                                 
 
                                 v a r   i m g _ u r l s   =   [ ] ; 
 
 
 
                                 f o r   ( i   =   0 ;   i   <   i m g . l e n g t h ;   i + + )   {     
 
                                         i f   ( ( i m g [ i ] . s r c . i n d e x O f ( " h t t p s : / / l a s t f m - i m g 2 . a k a m a i z e d . n e t / i / u / 1 7 4 s " )   = =   0 ) )   {   
 
                                                 i m g _ u r l s . p u s h ( i m g [ i ] . s r c . r e p l a c e ( " 1 7 4 s " ,   q u a l i t y [ d o w n l o a d _ q u a l i t y ] [ 2 ] ) ) ;   / / a r 0 
 
                                         } 
 
                                 } 
 
 
 
                                 i f   ( i m g _ u r l s . l e n g t h )   { 
 
                                         u t i l s . W r i t e I N I (   p a t h   +   " \ \ "   +   t _ a r t i s t   +   " _ a l b u m _ i n f o . i n i " ,   c l e a n _ i n i ( t _ a l b u m ) ,   l a n g _ a r r [ l a n g _ i d x ] ,   m e t a d a t a . j o i n ( " * " ) ) ; 	                                   
 
                                         v a r   i m g _ f i l e   =   " \ " "   +   p a t h   +   " \ \ "   +   t _ a r t i s t   +   " _ "   +   c l e a n ( t _ a l b u m )   +   " . j p g "   +   " \ " " ;     
 
                                         i f   ( ! f s o . F i l e E x i s t s ( i m g _ f i l e ) ) { 
 
                                                 i f   ( g _ i m g )   g _ i m g . D i s p o s e ( ) ; 
 
                                                 g _ i m g   =   n u l l ;       
 
                                                 i m a g e s   =   [ ] ; 	 	 	 
 
                                                 f i l e s   =   [ ] ; 	 
 
                                                 W s h S h e l l . R u n ( v b s   +   "   "   +   i m g _ u r l s [ 0 ]   +   "   "   +   i m g _ f i l e ,   0 ,   f a l s e ) ; 
 
                                         } 
 
                                   }                                 
 
                                 d o c . c l o s e ( ) ; 
 
                                 i f   ( i m g _ u r l s . l e n g t h   >   0   & &   ! g _ i m g )   { 
 
                                         g e t _ f i l e s _ i f _ l o a d e d ( p a t h ,   t _ a r t i s t ,   t _ a l b u m ) ; 
 
                                 }   e l s e   { 
 
                                         g e t _ t e x t ( ) ; 
 
                                 } 
 
                         }   e l s e   { g e t _ t e x t ( ) ; } 
 
                 }   
 
         }           
 
 } 
 
 
 
 f u n c t i o n   g e t _ l a s t F M _ m e t a _ t i t l e _ i m g ( p a t h ,   t _ a r t i s t ,   t _ a l b u m ,   t _ t i t l e ) { 
 
         v a r   q 1   =   e n c o d e U R I C o m p o n e n t ( t _ a r t i s t )   +   " / " ; 
 
         v a r   q 2   =   t _ a l b u m   ?   e n c o d e U R I C o m p o n e n t ( t _ a l b u m ) . r e p l a c e ( " % 2 B " ,   " % 2 5 2 B " )   +   " / "   :   " _ / " ; 
 
         v a r   q 3   =   t _ t i t l e   ?   e n c o d e U R I C o m p o n e n t ( t _ t i t l e )   :   " " ; 
 
         x m l h t t p 7   =   n e w   A c t i v e X O b j e c t ( " M i c r o s o f t . X M L H T T P " ) ; 
 
         u r l 7   =   ( " h t t p s : / / w w w . l a s t . f m / "   +   l a n g _ q u e r y ( l a n g _ i d x )   +   " m u s i c / "   +   q 1   +   q 2   +   q 3 ) ; 
 
         x m l h t t p 7 . o p e n ( " G E T " ,   u r l 7 ,   t r u e ) ; 	 	 	 	 	 	 	 
 
         x m l h t t p 7 . s e t R e q u e s t H e a d e r ( " I f - M o d i f i e d - S i n c e " ,   " S a t ,   1   J a n   2 0 0 0   0 0 : 0 0 : 0 0   G M T " ) ; 	 	 	 	 	 	 	 
 
         x m l h t t p 7 . s e n d ( n u l l ) ; 	 	 	 	 	 	 	 
 
         x m l h t t p 7 . o n r e a d y s t a t e c h a n g e   =   f u n c t i o n   ( )   { 	 	 	 	 	 	 	 
 
                 i f   ( x m l h t t p 7 . r e a d y S t a t e   = =   4 )   { 	 	 	 	 	 	 	 
 
                         i f   ( x m l h t t p 7 . s t a t u s   = =   2 0 0 )   { 	 	 	 	 	 	 	 
 
                                 d o c . o p e n ( ) ; 	 	 	 	 	 	 	 
 
                                 v a r   d i v   =   d o c . c r e a t e E l e m e n t ( " d i v " ) ; 	 	 	 	 	 	 	 
 
                                 d i v . i n n e r H T M L   =   x m l h t t p 7 . r e s p o n s e t e x t ; 	 
 
                                 v a r   i m g   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " i m g " ) ; 
 
                                 v a r   d v   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " d i v " ) ; 	 	 	 	 	 	 
 
                                 v a r   h 2   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " h 2 " ) ; 	 
 
                                 v a r   h 3   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " h 3 " ) ; 
 
                                 v a r   p   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " p " ) ; 
 
                                 v a r   a   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " a " ) ; 	 
 
 
 
                                 v a r   d a t a   =   [ ] ; 
 
                                 v a r   a l b u m _ n a m e   =   " " ; 
 
 
 
                                 f o r   ( i   =   0 ;   i   <   h 2 . l e n g t h ;   i + + )   { 	 	 	 	 	 	 
 
                                         i f   ( h 2 [ i ] . c l a s s N a m e   = =   " f e a t u r e d - i t e m - h e a d i n g " )   { 	 	 	 	 	 	 
 
                                                 d a t a . p u s h ( h 2 [ i ] . i n n e r T e x t ) ; 
 
                                                 b r e a k ; 	 	 	 	 	 	 
 
                                         } 
 
                                 } 
 
 
 
                                 v a r   a l b u m _ n a m e ; 
 
 
 
                                 f o r   ( i   =   0 ;   i   <   h 3 . l e n g t h ;   i + + )   { 	 	 	 	 	 	 
 
                                         i f   ( h 3 [ i ] . c l a s s N a m e   = =   " f e a t u r e d - i t e m - n a m e " )   { 
 
                                                 a l b u m _ n a m e   =   h 3 [ i ] . i n n e r T e x t ; 	 	 	 	 	 	 
 
                                                 d a t a . p u s h ( h 3 [ i ] . i n n e r T e x t . t o U p p e r C a s e ( )   +   " * " ) ; 
 
                                                 b r e a k ; 	 	 	 	 	 	 
 
                                         } 
 
                                 } 
 
                                 
 
                                 f o r   ( i   =   0 ;   i   <   p . l e n g t h ;   i + + )   { 	 	 	 	 	 	 
 
                                         i f   ( p [ i ] . c l a s s N a m e   = =   " f e a t u r e d - i t e m - s t a t s " )   { 	 	 	 	 	 	 
 
                                                 d a t a . p u s h ( p [ i ] . i n n e r T e x t . r e p l a c e ( / , / g ,   "   " )   +   " * " ) ; 
 
                                                 b r e a k ; 	 	 	 	 	 	 
 
                                         } 
 
                                 } 
 
 
 
                                 f o r   ( i   =   0 ;   i   <   h 2 . l e n g t h ;   i + + )   { 	 	 	 	 	 	 
 
                                         i f   ( h 2 [ i ] . c l a s s N a m e   = =   " m e t a d a t a - t i t l e " )   { 	 	 	 	 	 	 
 
                                                 d a t a . p u s h ( h 2 [ i ] . i n n e r T e x t ) ; 
 
                                                 b r e a k ; 	 	 	 	 	 	 
 
                                         } 
 
                                 } 
 
                                 
 
                                 f o r   ( i   =   0 ;   i   <   a . l e n g t h ;   i + + )   { 	 
 
                                         i f   ( a [ i ] . c l a s s N a m e . i n d e x O f ( " i m a g e - o v e r l a y - p l a y l i n k - l i n k " )   <   0 ) {     
 
                                                 i f   ( a [ i ] . t i t l e )   d a t a . p u s h ( a [ i ] . t i t l e ) ; 
 
                                         } 
 
                                 } 
 
 
 
                                 f o r   ( i   =   0 ;   i   <   d v . l e n g t h ;   i + + )   { 	 	 	 	 	 	 
 
                                         i f   ( d v [ i ] . c l a s s N a m e   = =   " a d d i t i o n a l - r e l e a s e - c o u n t " )   { 	 	 	 	 	 	 
 
                                                 d a t a . p u s h ( d v [ i ] . i n n e r T e x t ) ; 
 
                                                 b r e a k ; 	 	 	 	 	 	 
 
                                         } 
 
                                 } 
 
 
 
                                 v a r   i m g _ u r l s   =   [ ] ; 
 
 
 
                                 f o r   ( i   =   0 ;   i   <   i m g . l e n g t h ;   i + + )   {     
 
                                         i f   ( ( i m g [ i ] . s r c . i n d e x O f ( " h t t p s : / / l a s t f m - i m g 2 . a k a m a i z e d . n e t / i / u / 1 7 4 s " )   = =   0 ) )   {   
 
                                                 i m g _ u r l s . p u s h ( i m g [ i ] . s r c . r e p l a c e ( " 1 7 4 s " ,   q u a l i t y [ d o w n l o a d _ q u a l i t y ] [ 1 ] ) ) ; 
 
                                         } 
 
                                 } 
 
                                 
 
                                 i f   ( i m g _ u r l s . l e n g t h )   { 
 
                                         u t i l s . W r i t e I N I (   p a t h   +   " \ \ "   +   t _ a r t i s t   +   " _ t i t l e _ i n f o . i n i " ,   c l e a n _ i n i ( t _ t i t l e ) ,   0 ,   a l b u m _ n a m e ) ; 
 
                                         u t i l s . W r i t e I N I (   p a t h   +   " \ \ "   +   t _ a r t i s t   +   " _ t i t l e _ i n f o . i n i " ,   c l e a n _ i n i ( t _ t i t l e ) ,   l a n g _ a r r [ l a n g _ i d x ] ,   d a t a . j o i n ( " * " ) ) ; 
 
                                         v a r   i m g _ f i l e   =   " \ " "   +   p a t h   +   " \ \ "   +   t _ a r t i s t   +   " _ "   +   c l e a n ( a l b u m _ n a m e )   +   " . j p g "   +   " \ " " ;   
 
                                         i f   ( a l b u m _ n a m e   & &   ! f s o . F i l e E x i s t s ( i m g _ f i l e ) ) { 	 
 
                                         i f   ( g _ i m g )   g _ i m g . D i s p o s e ( ) ; 
 
                                                 g _ i m g   =   n u l l ;       
 
                                                 i m a g e s   =   [ ] ; 	 	 	 
 
                                                 f i l e s   =   [ ] ; 	 
 
                                                 W s h S h e l l . R u n ( v b s   +   "   "   +   i m g _ u r l s [ 0 ]   +   "   "   +   i m g _ f i l e ,   0 ,   f a l s e ) ; 
 
                                         } 
 
                                   } 
 
                                 d o c . c l o s e ( ) ; 
 
                                 i f   ( i m g _ u r l s . l e n g t h   >   0   & &   ! g _ i m g   & &   a l b u m _ n a m e )   { 
 
                                         g e t _ f i l e s _ i f _ l o a d e d ( p a t h ,   t _ a r t i s t ,   a l b u m _ n a m e ,   t _ t i t l e ) ; 
 
                                 }   e l s e   { 
 
                                         g e t _ t e x t ( ) ; 
 
                                 } 
 
                         }   e l s e   { g e t _ t e x t ( ) ; } 
 
                 } 
 
         } 	 	 	 	 	 	 
 
 } 
 
 
 
 f u n c t i o n   g e t _ l a s t F M _ m e t a _ t i t l e _ t e x t ( f i l e ,   t _ a r t i s t ,   t _ a l b u m ,   t _ t i t l e ) { 
 
         p a t h   =   a r t i s t _ f o l d e r _ p a t h ( m e t a _ a r t i s t ) ; 
 
         v a r   q 1   =   e n c o d e U R I C o m p o n e n t ( t _ a r t i s t )   +   " / " ; 
 
         v a r   q 2   =   t _ a l b u m   ?   e n c o d e U R I C o m p o n e n t ( t _ a l b u m ) . r e p l a c e ( " % 2 B " ,   " % 2 5 2 B " )   +   " / "   :   " _ / " ; 
 
         v a r   q 3   =   t _ t i t l e   ?   e n c o d e U R I C o m p o n e n t ( t _ t i t l e )   :   " _ " ; 
 
         x m l h t t p 8   =   n e w   A c t i v e X O b j e c t ( " M i c r o s o f t . X M L H T T P " ) ; 	 	 	 	 	 	 	 
 
         u r l 8   =   ( " h t t p s : / / w w w . l a s t . f m / "   +   l a n g _ q u e r y ( l a n g _ i d x )   +   " m u s i c / "   +   q 1   +   q 2   +   q 3   +   " / + w i k i " ) ; 
 
         x m l h t t p 8 . o p e n ( " G E T " ,   u r l 8 ,   t r u e ) ; 	 	 	 	 	 	 	 
 
         x m l h t t p 8 . s e t R e q u e s t H e a d e r ( " I f - M o d i f i e d - S i n c e " ,   " S a t ,   1   J a n   2 0 0 0   0 0 : 0 0 : 0 0   G M T " ) ; 	 	 	 	 	 	 	 
 
         x m l h t t p 8 . s e n d ( n u l l ) ; 	 	 	 	 	 	 	 
 
         x m l h t t p 8 . o n r e a d y s t a t e c h a n g e   =   f u n c t i o n   ( )   { 	 	 	 	 	 	 	 
 
                 i f   ( x m l h t t p 8 . r e a d y S t a t e   = =   4 )   { 	 	 	 	 	 	 	 
 
                         i f   ( x m l h t t p 8 . s t a t u s   = =   2 0 0 )   { 	 	 	 	 	 	 	 
 
                                 d o c . o p e n ( ) ; 	 	 	 	 	 	 	 
 
                                 v a r   d i v   =   d o c . c r e a t e E l e m e n t ( " d i v " ) ; 	 	 	 	 	 	 	 
 
                                 d i v . i n n e r H T M L   =   x m l h t t p 8 . r e s p o n s e t e x t ; 	 	 	 	 	 	 	 
 
                                 v a r   d i v   =   d i v . g e t E l e m e n t s B y T a g N a m e ( " d i v " ) ; 	 	 	 	 	 	 
 
                                 v a r   t   =   " " ; 	 	 	 	 	 	 
 
                                 	 	 	 	 	 	 
 
                                 v a r   s a v e _ t e x t   =   f a l s e ; 	 	 	 	 	 	 
 
                                 	 	 	 	 	 	 
 
                                 f o r   ( i   =   0 ;   i   <   d i v . l e n g t h ;   i + + )   { 	 	 	 	 	 	 
 
                                         i f   ( d i v [ i ] . c l a s s N a m e   = =   " w i k i " )   { 	 	 	 	 	 	 
 
                                                 t   =   d i v [ i ] . i n n e r H T M L ; 	 
 
                                                 s a v e _ t e x t   =   t . i n d e x O f ( ' w i k i - c o n t e n t ' )   >   0   ?   t r u e   :   f a l s e ; 	 	 	 	 	 	 
 
                                                 t   =   s t r i p _ t a g s ( t ) . r e p l a c e ( / ^ \ s + | \ s + $ / g ,   " " ) ; 	 	 	 	 	 	 
 
                                                 b r e a k ; 	 	 	 	 	 	 
 
                                         }   	 	 	 	 	 	 
 
                                 }   
 
                                 d o c . c l o s e ( ) ; 
 
                         } 
 
                         i f   ( t )   { 
 
                                 t e x t   =   t ;   
 
                                 s a v e _ t e x t   & &   s a v e _ t x t _ f i l e ( t ,   f i l e ) ; 
 
                         }   e l s e   { 
 
                                 t e x t   =   g e t _ t e x t _ n f ( l a n g _ a r r [ l a n g _ i d x ] ) ; 
 
                         } 
 
                         g e t _ t e x t _ a r r a y ( ) ; 	 
 
                 } 
 
         } 	 	 	 	 	 	 
 
 } 
 
 	 	 	 	 	 
 
 f u n c t i o n   p r i n t ( m s g )   { 	 	 	 	 	 
 
         f b . t r a c e ( m s g ) ; 	 	 	 	 	 
 
 } 	 	 	 	 	 
 
 	 	 	 	 	 
 
 f u n c t i o n   o n _ n o t i f y _ d a t a ( n a m e ,   i n f o )   { 
 
         i f ( n a m e   = =   " p a n e l " )   { 
 
                 i f   ( i n f o   = =   " b i o " ) { 
 
                         p a n e l _ o n   =   t r u e ; 
 
                         m e t a _ a r t i s t   =   " " ; 
 
                         o n _ m e t a d b _ c h a n g e d ( ) ; 
 
                 }   e l s e { 
 
                         p a n e l _ o n   =     f a l s e ; 
 
                 } 
 
         } 
 
 } 
 
 